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: "Etsuro Fujita" <fujita.etsuro@lab.ntt.co.jp>
Cc: "'Craig Ringer'" <ringerc@ringerc.id.au>, pgsql-hackers@postgresql.org
Date: 2012-09-19T03:32:48Z
Lists: pgsql-hackers
"Etsuro Fujita" <fujita.etsuro@lab.ntt.co.jp> writes: >> From: Tom Lane [mailto:tgl@sss.pgh.pa.us] >> I think it would be better to present this as something like >> \copy foo from '/home/pgsql/decompress.sh /home/pgsql/foo.csv.gz |' with >> format 'csv' > I have a question. I think it would be also better to extend the syntax for the > SQL COPY command in the same way, ie, > COPY foo from '/home/pgsql/decompress.sh /home/pgsql/foo.csv.gz |' with format > 'csv' Yeah, sure --- that case is already superuser-only, so why not give it the option of being a popen instead of just fopen. My objection was only that it sounded like you were providing *only* the ability to run the external processors on the server side. Providing popen on both sides seems completely sensible. regards, tom lane