pg_restore is not recognizing dump

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Oakavenue
    New Member
    • Jul 2007
    • 2

    #1

    pg_restore is not recognizing dump

    Hi, I am trying to restore a dump from an earlier version of Postgre but it does not recognise the dump. The OK button in pgAdmin stays greyed out after choosing dump.
    Please help!
  • michaelb
    Recognized Expert Contributor
    • Nov 2006
    • 534

    #2
    I would try to to restore this dump manually.
    Depending on the format chosen to create this backup you should be able to either load it from the psql prompt, or using pg_restore.
    Read about pg_dump and pg_restore
    (which by the way has the --ignore-version switch), then check on the format of your data-dump.

    If you have any questions we'll help you here.

    Comment

    • Oakavenue
      New Member
      • Jul 2007
      • 2

      #3
      The database dump is a flat text file. I created an empty database in pgAdmin 3. Then I opened psql command and then I see the postgres=# command, then I type in databasename < filename and then press enter and nothing happens. So I don't know what I am doing wrong.

      Comment

      • michaelb
        Recognized Expert Contributor
        • Nov 2006
        • 534

        #4
        You are supposed to "source in" the dump, so the command would be
        \i <pathname>

        Also keep in mind that depending on the options used to create the dump it may start with trying to create the database, meaning you need to drop it before you source the dump file.

        Take a look at the first 20 lines of the dump file to see if any prep work is needed before you load the backup.

        Comment

        Working...