Re: WIP patch: add (PRE|POST)PROCESSOR options to COPY

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, Simon Riggs <simon@2ndquadrant.com>, Fujii Masao <masao.fujii@gmail.com>, Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>, Craig Ringer <ringerc@ringerc.id.au>, pgsql-hackers@postgresql.org
Date: 2012-11-14T16:39:44Z
Lists: pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> Yeah, I agree, although the syntax looks a bit unclean.

Oh, I had not looked at the syntax closely.  I agree, that basically
sucks: it's overcomplicated and under-featured, because you can't
control the actual program command line very conveniently.  Nor do I see
a reason to force this into the model of "program filtering a specific
file".  What happened to the previous proposal of treating the COPY
target as a pipe specification, ie

	COPY table FROM 'some command line |';
	COPY table TO '| some command line';

> Not sure what we'd do for \copy though.

Adding a pipe symbol to the target works exactly the same for \copy.

			regards, tom lane