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

From Alvaro Herrera
Subject Re: WIP patch: add (PRE|POST)PROCESSOR options to COPY
Date
Msg-id 20121114155551.GD5161@alvh.no-ip.org
Whole thread Raw
In response to Re: WIP patch: add (PRE|POST)PROCESSOR options to COPY  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: WIP patch: add (PRE|POST)PROCESSOR options to COPY  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Simon Riggs escribió:
> On 14 November 2012 15:09, Fujii Masao <masao.fujii@gmail.com> wrote:
>
> >> Here, progname for COPY IN is the user-supplied program that takes filename as
> >> its argument and that writes on standard output.
> >
> > What about further extending the COPY IN syntax to the following?
> >
> >     COPY table_name FROM 'progname [ option, ... ]' WITH ...
> >
> > I'd just like to execute
> >
> >     COPY vmstat_table FROM 'vmstat' WITH ...
>
> I think we should be using FDWs/SRFs here, not inventing new
> syntax/architectures for executing external code, so -1 from me.

Hmm, but then you are forced to write C code, whereas the "external
program" proposal could have you writing a only shell script instead.
So there is some merit to this idea ... though we could have a
"pipe_fdw" that could let you specify an arbitrary program to run.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: WIP patch: add (PRE|POST)PROCESSOR options to COPY
Next
From: Amit Kapila
Date:
Subject: Re: [PATCH] Patch to compute Max LSN of Data Pages