I think I’ve found a bug in PG 8.0 that occurs while copying from CSV files.
I checked the bugs list but didn’t see anything similar.
This occurs when reading a CSV file where one of the ‘text’ fields has
a blank line. I included an example that shows the problem below.
I found that if I change the blank line to have one space, pg reads
it just fine.
If this is indeed a bug, if someone could let me know the best
way to address it, I would appreciate it.
--EXAMPLE
create table t (
id integer,
description text
);
copy t from stdin with null as '' csv quote as '"';
1,"Now is the time"
2,"for all good men
to come
to the
aid of their party"
3,"The quick brown fox"
\.
--END EXAMPLE
The above example produces this output:
CREATE TABLE
psql:test2.sql:8: ERROR: unterminated CSV quoted field
CONTEXT: COPY t, line 5: ""