On Sun, 14 Apr 2002, Bruce Momjian wrote: > > Gavin, I will do the legwork on this if you wish. I think we need to
No matter. I intended to submit a patch to fix this. > use DefElem to store the COPY params, rather than using specific fields > in CopyStmt. DefElem would have required modification of code outside the parser (to keep utility.c and DoCopy() happy) or otherwise an even messier loop executed as a result of CopyStmt than I have given in the attached patch, plus other issues with Yacc. The patch attached maintains backward compatibility. The syntax is as follows: COPY [BINARY] <relname> [WITH OIDS] FROM/TO [USING DELIMITERS <delimiter>] [WITH [ DELIMITER <delimiter> | NULL AS <char> | OIDS ]] I was also going to allow BINARY in the WITH list, but there seems to be little point. Note that if you execute a query such as: COPY pg_class TO '/some/path/file/out' USING DELIMITERS <tab> WITH DELIMITER '|'; The code will give preference to WITH DELIMITER. If no one can find fault with this or my implementation, I'll follow up with documentation and psql patches (not sure that there is much point patching pg_dump). Gavin
copy2.diff.gz
Description: GNU Zip compressed data
---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])