I have just been alerted to a bug in the 8.0 handling of embedded
newlines in CSV data. Basically it barfs on consecutive newlines. The
attached patch for 8.0 appears to fix it. The bug isn't present in the
HEAD branch, and I'm wondering if we should not backpatch the HEAD
multiline patch rather than applying this. OTOH, applying this patch
would probably be more in keeping with our conservative approach to
changes to stable branches, I guess.
cheers
andrew
Index: src/backend/commands/copy.c
===================================================================
RCS file: /home/cvsmirror/pgsql/src/backend/commands/copy.c,v
retrieving revision 1.236
diff -c -r1.236 copy.c
*** src/backend/commands/copy.c 31 Dec 2004 21:59:41 -0000 1.236
--- src/backend/commands/copy.c 11 May 2005 21:12:07 -0000
***************
*** 2395,2400 ****
--- 2395,2401 ----
if (done && line_buf.len == 0)
break;
start_cursor = line_buf.cursor;
+ continue;
}
end_cursor = line_buf.cursor;