Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (20.3k points)

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 I didn't get a clear answer.

1 Answer

0 votes
by (40.7k points)

In Postgres, "\N" is used as a substitute symbol for a NULL value. 

But all the psql commands start with backslash "\" symbol. Therefore, you may get the messages like a copy statement fails, but the loading of dump continues. This message will be a false alarm. 

You need to search the lines before,  for the reason why the COPY statement fails.

It's possible to switch psql to "stop on first error" mode and to find error like this:

psql -v ON_ERROR_STOP=1

If you wish to learn SQL then visit this SQL Training.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 4, 2019 in SQL by Tech4ever (20.3k points)

Browse Categories

...