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

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WIP patch: add (PRE|POST)PROCESSOR options to COPY
Date: 2012-11-14 19:22:11
Message-ID: 50A3EF63.3070405@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 11/14/2012 02:05 PM, Peter Eisentraut wrote:
> On 11/14/12 11:50 AM, Andrew Dunstan wrote:
>>> COPY table FROM 'some command line |';
>>> COPY table TO '| some command line';
>>>
>>
>> I'd like to be able to filter STDIN if possible - with this syntax how
>> is COPY going to know to hook up STDIN to the program?
> Why don't you filter the data before it gets to stdin? Some program is
> feeding the data to "stdin" on the client side. Why doesn't that do the
> filtering? I don't see a large advantage in having the data be sent
> unfiltered to the server and having the server do the filtering.

Centralization of processing would be one obvious reason. I don't really
see why the same reasoning doesn't apply on the backend. You could just
preprocess the input before calling COPY (via a plperlu function for
example). If we're going to have filtering functionality then it should
be as general as possible, ISTM. But I seem to be alone in this, so I
won't push it.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-11-14 19:37:52 Re: WIP patch: add (PRE|POST)PROCESSOR options to COPY
Previous Message Atri Sharma 2012-11-14 19:12:27 Re: WIP patch for hint bit i/o mitigation