Folks, This came up at work...
I have seed database scripts quasi-generated from pg_dump which include COPY statements, but the data is hard to edit (especially cut & paste operations) when the COPY delimiter is some non-visible character like \t. So I thought it would be handy to be able to control the DELIMITER and NULL options in COPY statements that pg_dump uses. Although it would be nice to make CSV and its dependencies one of the options, I'm not sure how pg_dump would handle the end-of-line problem, so I've skipped that part in the patch I've put together. The other option, FORCE QUOTE, doesn't make sense to me as a pg_dump option, but I'm not the arbiter of these things. With the patch, pg_dump would work exactly as usual without options, but it now has two extra options: --copy-delimiter and --copy-null. If set, these will be incorporated in COPY commands as appropriate. --copy-delimiter accepts any single byte other than '\r' or '\n'. --copy-null accepts any input. The patched pg_dump ignores --copy-* options in cases where COPY wouldn't happen anyway. What do you folks think? Cheers, D -- David Fetter [EMAIL PROTECTED] http://fetter.org/ phone: +1 415 235 3778 Remember to vote! ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq