3

When trying to import an .out file back into a postgres database, I get many (thousands) of rows like this: psql:G:/Backup/main_db_backup.out:251875: invalid command \

With a different number where "251875" is each line

Does this mean the restore will not work?

Has anyone encountered this before? I couldn't find anything online regarding this message during a restore

Thank you for any assitance!

SLipman
  • 31
  • 1
  • 2
  • How did you create the file? – jordanm Dec 08 '16 at 20:34
  • 4
    This is **almost** certainly a `COPY` command that has some error in the middle causing the `COPY` to abort and treat the remaining lines as (invalid) SQL. You'll need to capture the very first error message and start from there. – DerfK Dec 08 '16 at 20:37
  • 3
    Run psql with `-v ON_ERROR_STOP=1` – Craig Ringer Dec 09 '16 at 00:27
  • Sorry cannot comment yet... These errors I get when I run `COPY` command against table with different structure than exported data. Output file from `COPY` command is tab delimited and tries to fill target table columns just by plain order of values in file. – JosMac Dec 09 '16 at 10:46

0 Answers0