psql restore from pg_dump file – invalid command \N

when searching for this error ‘invalid command \N’ when trying to restore my database from a backup I made with the following:

$ pg_dump -d foo -t bar > bar.psql

I got lots of suggestions but what I needed was to drop the darn table before restoring it …

$psql
foo=> drop table bar;

$psql < bar.psql

Leave a Reply