#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    2
    Rep Power
    0

    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?

    Thanks!
    Sean
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Location
    Usually Japan when not on contract
    Posts
    240
    Rep Power
    12
    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.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    2
    Rep Power
    0
    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.

    Thanks!

IMN logo majestic logo threadwatch logo seochat tools logo