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

Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>

From: "Etsuro Fujita" <fujita.etsuro@lab.ntt.co.jp>
To: "'Tom Lane'" <tgl@sss.pgh.pa.us>, "'Robert Haas'" <robertmhaas@gmail.com>
Cc: "'Craig Ringer'" <craig@2ndquadrant.com>, "'Simon Riggs'" <simon@2ndquadrant.com>, "'Fujii Masao'" <masao.fujii@gmail.com>, "'Craig Ringer'" <ringerc@ringerc.id.au>, <pgsql-hackers@postgresql.org>
Date: 2012-11-22T12:10:08Z
Lists: pgsql-hackers

Attachments

I wrote:
> > The biggest problem this patch has had from the very beginning is
> > overdesign, and this is more of the same.  Let's please just define the
> > feature as "popen, not fopen, the given string" and have done.  You can
> > put all the warning verbiage you want in the documentation.  (But note
> > that the server-side version would be superuser-only in any flavor of
> > the feature.)
> 
> Agreed.  I'll reimplement the feature using the PROGRAM keyword:
> 
> > 	COPY TABLE FROM PROGRAM 'command line';
> > 	COPY TABLE TO PROGRAM 'command line';

I've reimplemented the feature.  Attached is an updated version of the patch.

Todo:
    * More documents
    * More tests

Any comments are welcomed.

Thanks,

Best regards,
Etsuro Fujita