Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2015
    Location
    Texas
    Posts
    1

    Unanswered: Import practice database into postgresql. Syntax prob?

    Im pretty new to the postgresql world.

    I've got a vm (ubuntu) and have postgresql / pgAdmin3.

    Ive downloaded the northwind.postgre.sql file to my '/tmp' folder.

    in the terminal, logged into postgres..

    "postgres=# \i /tmp/northwind.postgre.sql" keeps giving me a No such file or directory.

    I know it is there, but this is an example of my current level of ignorance.


    Any advice on syntax?

    Andy

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    I don't know this "northwind" thing. But usually the DBMS is called Postgres, not "postgre".

    So maybe the file is actually named "northwind.postgres.sql"?
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags: http://www.dbforums.com/misc.php?do=bbcode#code

    Tips for good questions:

    http://tkyte.blogspot.de/2005/06/how...questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

  3. #3
    Join Date
    Mar 2015
    Location
    Indonesia
    Posts
    3
    There is many way to import postgresql database, but first you must login to psql and use specific database
    that you want to restore .
    Example :
    Code:
    psql -U userid -d nameofdatabase
    Code:
    nameofdatabase=# \i "path_of_sql_file\nameofsql.sql"
    or you can direct insert in terminal ;

    Code:
    cd /tmp
    Code:
    psql -U userid -d nameofdatabase -1 -f nameofsql.sql
    sorry for my bad english , i hope u understand

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •