psql invalid command \N while restore sql

前端 未结 14 869
后悔当初
后悔当初 2020-12-04 15:54

I\'m trying to restore my dump file, but it caused an error:

psql:psit.sql:27485: invalid command \\N

Is there a solution? I searched, but

14条回答
  •  暖寄归人
    2020-12-04 16:43

    I received the same error message when trying to restore from a binary pg_dump. I simply used pg_restore to restore my dump and completely avoid the \N errors, e.g.

    pg_restore -c -F t -f your.backup.tar

    Explanation of switches:

    -f, --file=FILENAME      output file name
    -F, --format=c|d|t       backup file format (should be automatic)
    -c, --clean              clean (drop) database objects before recreating
    

提交回复
热议问题