Postgresql db restoring from dump fails

postgresql

I have a dump file from a Postgresql db.
However, If i run psql -U user < db.sql under Windows, i get

 ERROR:  missing data for column "x"

for certain lines. Thing is, the data for "x" is not missing. I'm guessing there are some characters in the column preceding "x" that somehow corrupt the import, but i have no idea what it might be.

Any ideas? Postgre version is 8.3.7

Edit: It would be fine to omit the offending lines, if restoring process could continue gracefully after encountering the line.

Edit2: It appears the culprit is the Ctrl-Z chracters (ascii 26) in the dump, which are interpreted as end-of-file under windows(?).

Best Answer

Have you tried passing the file using the -f flag instead of redirecting the input? Perhaps your console's redirection is acting weird:

psql -U user -f db.sql

Considering it's on Windows, I wouldn't be surprised if this was the case.