databasepostgresqlpg-restore

Restoring from Postgres sql file


I have a backup from PostgresSQL database created this way:

/usr/bin/pg_dump --no-owner --no-acl > dump.sql

When I try to restore on a different machine:

psql db < dump.sql it trows many errors: invalid command \N

When I try to use pg_restore:

pg_restore dump.sql -d db

Different error: pg_restore: [archiver] input file appears to be a text format dump. Please use psql.

According to documentation this should be a non issue.

Any way to tell psql that \N character is a null value?


Solution

  • Oh hi me, it's me

    Make sure:

    Also eat healthy and get good rest. k bye