Convert old dump to eliminate invalid command \N
After much time researching, I understand why my old dump won't import.
psql:/home/sean/TMS.sql:10449: invalid command \N
Is there a way to convert this file to work? It's an old DB I'd like to import, and it's the only thing I have of it?
What was the first error you got? COPY might just be trying to read data as commands because of something relatively silly like a quote escape or attempt to store a literal '\N' or '\\N' in the database and trying to interpret it as a command.
Sometimes with things like that its better to sed s/\\N/NULL/g to reconfigure the NULL value if \\N is also used somewhere as a literal.
If you can't figure it out post a sample of a few lines above the first error and the first error message.
I was able to separate the create db, tables, functions, etc and work out those errors. After that, it appears I could use psql to import. After about 6 hours of pulling my hair out, I may have figured it out. We'll see. I need to check over the data.