Re: WIP patch: add (PRE|POST)PROCESSOR options to COPY - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: WIP patch: add (PRE|POST)PROCESSOR options to COPY
Date
Msg-id 50A3C7BA.7030000@dunslane.net
Whole thread Raw
In response to Re: WIP patch: add (PRE|POST)PROCESSOR options to COPY  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: WIP patch: add (PRE|POST)PROCESSOR options to COPY  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 11/14/2012 11:20 AM, Tom Lane wrote:
> I disagree with Simon's objection also, because neither reading from
> nor writing to an external program is likely to fit the model of
> reading/updating a table very well.  For instance, there's no good
> reason to suppose that reading twice will give the same results.  So
> force-fitting this usage into the FDW model is not going to work well.
>
> Nor do I really see the argument why a "pipe_fdw" module is cleaner
> than a "COPY TO/FROM pipe" feature.
>
>             


Yeah, I agree, although the syntax looks a bit unclean.

Maybe something like
    COPY foo FROM wherever WITH (FILTER '/path/to/program')

might work better. You'd hook up the source to the filter as its stdin 
and read its stdout. Not sure what we'd do for \copy though.


cheers

andrew




pgsql-hackers by date:

Previous
From: Nicholas White
Date:
Subject: Re: S_ISLNK
Next
From: Simon Riggs
Date:
Subject: Re: WIP patch: add (PRE|POST)PROCESSOR options to COPY