On Mon, Aug 16, 2004 at 11:30:49AM -0400, Tom Lane wrote: > The bigger question is whether this would do anything to satisfy the > requestor. He probably wants the headings to appear in the file > resulting from COPY TO file (or the psql equivalent), which this would > not do. Providing the info in the COPY PGresult would change nothing > except the behavior of client applications specially rewritten to use it.
True, and from a compatibility standpoint that would probably be good... Output post-processing (translation to CSV or XML output, XSLT transforms, what have you) IMHO should probably go on top of COPY anyway, rather than into it. Are people really having problems with select * from table where 1=0 ; copy table to stdout and first printing the column names found in the first PGresult, then dumping the COPY lines to the same fd? I think that should do the trick for most uses, although obviously I'm no expert. Jeroen ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster