Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm trying to restore a db dump from PostgreSQL 9.2 to PostgrSQL 8.4 (from separate machines, both are running Windows 7).

I followed the instructions in this answer: Use pg_restore to restore from a newer version of PostgreSQL.

However,the screen keeps writing

invalid command \N  invalid command \N
invalid command \N  invalid command \N
invalid command \N  invalid command \N

How can I resolve this issue?

I cannot see any GIS software involved in this Question so it would appear better suited to StackOverflow –  PolyGeo May 6 '13 at 4:51
@PolyGeo: I think dba.stackexchange is meant for these kinds of questions. –  Devdatta Tengshe May 6 '13 at 5:54
Well, pg_restore is for dumps created using the -F {c|d|t} option of pg_dump. If you didn't that, going to the dump you will find a plain text file, showing all the CREATE and other commands. In this case try to restore it using psql. –  dezso May 6 '13 at 12:30
comments disabled on deleted / locked posts

migration rejected from gis.stackexchange.com Sep 16 '13 at 2:52

This question came from our site for cartographers, geographers and GIS professionals. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as off-topic by dezso, Mark Storey-Smith, bluefeet, RolandoMySQLDBA, Max Vernon Sep 16 '13 at 2:52

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – dezso, Mark Storey-Smith, bluefeet, RolandoMySQLDBA, Max Vernon
If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 0 down vote accepted

First my recommendation is to start with text dumps and expect you may need to manually edit them. There are a large number of differences between 9.2 and 8.4 and these are especially important if you have used extensions in 9.2.

There are however a few things you can do to make the import less troublesome but slower:

  • Don't use -F to select a format. Work with plain text dumps since you can edit them if you need to.

  • Don't use -j. Keep things simple.

  • Use --inserts, so INSERT statements are used instead of copy.

Be prepared to edit the dump if needed. Be comfortable with text editors used for managing large files (vim or emacs, both of which have Windows versions).

add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.