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.