If invalid command \N
is shown when restoring a sql file, it worth trying to run with ON_ERROR_STOP
option. Another(the actual) error may be found.
psql -v ON_ERROR_STOP=1 -Uuser < foo.sql
https://stackoverflow.com/questions/20427689/psql-invalid-command-n-while-restore-sql