Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2011

    Unanswered: Cant restore database dump

    Hi all,

    I was running openSuSE 11.1 with postgresql 8.3.5 In an attempt to upgrade to openSuSE 11.3
    I backed up my postgresql - "pg_dump -U postgres ctalk -f ctalk.dump"

    After upgrading,
    I have installed the following feartures:

    # uname -a
    Linux 2.6.34-12-default #1 SMP 2010-06-29 02:39:08 +0200 i686
    i686 i386 GNU/Linux

    I have created the database and given it the previous owner.
    createdb -T template0 ctalk

    Then changed user to postgres

    Then attempted to restore the database from the ctalk.dump
    postgres@talklite:/home> psql -U postgres -d ctalk -f ctalk.dump

    Then I get this error:

    when I run this command, attached is the message I get.
    psql:ctalk.dump:757713: invalid command \N
    psql:ctalk.dump:757714: invalid command \N
    psql:ctalk.dump:757715: invalid command \N
    psql:ctalk.dump:757716: invalid command \N
    psql:ctalk.dump:757717: invalid command \N
    psql:ctalk.dump:757718: invalid command \N
    psql:ctalk.dump:757719: invalid command \N
    psql:ctalk.dump:757720: invalid command \.
    psql:ctalk.dump:757727: ERROR: syntax error at or near "1"
    LINE 1: 1 1221 2008-02-08 21:59:59.438569 17637234 17637237 '1763723...
    psql:ctalk.dump:757730: invalid command \.
    psql:ctalk.dump:757737: ERROR: syntax error at or near "2"
    LINE 1: 2 2 1
    psql:ctalk.dump:767084: invalid command \.
    psql:ctalk.dump:767091: ERROR: syntax error at or near "1"
    LINE 1: 1 17618632 18 171 U last_activity='2008-02-08 20:03:13.92297...

    I attempted to revert back to postgresql 8.3.5 to see if its an issue with the difference in versions but my error was the same.

    Please assist me



  2. #2
    Join Date
    Nov 2003
    Provided Answers: 8
    It seems that the dump file was written with the custom format.
    Is it a readable SQL file?

    Otherwise you need to use pg_restore to restore the file

  3. #3
    Join Date
    Jan 2011

    cant restore database dump

    Yes its a readable text file. Should I still use pg_restore?


  4. #4
    Join Date
    Nov 2003
    Provided Answers: 8
    Quote Originally Posted by dmuwa21 View Post
    Yes its a readable text file. Should I still use pg_restore
    If it is a SQL file, then psql is the right tool.

    Can you post the first 5-10 lines of that file? (And please make sure you enclose them in [code] tags!)

Posting Permissions

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