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

From Tom Lane
Subject Re: WIP patch: add (PRE|POST)PROCESSOR options to COPY
Date
Msg-id 20901.1352911615@sss.pgh.pa.us
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  (Craig Ringer <craig@2ndQuadrant.com>)
List pgsql-hackers
Simon Riggs <simon@2ndQuadrant.com> writes:
> On 14 November 2012 15:09, Fujii Masao <masao.fujii@gmail.com> wrote:
>> I'd just like to execute
>> COPY vmstat_table FROM 'vmstat' WITH ...

> If we go ahead with this, I think it needs additional keyword to
> indicate that we will execute the file rather than read from it. I
> don't think we should rely on whether the file is executable or not to
> determine how we should treat it.

Agreed, and there's also the question of passing switches etc to the
program, so the string can't be a bare file name anyway.  I proposed
pipe symbols (|) in the string previously, but if you find that too
Unix-centric I suppose we could do
COPY TABLE FROM PROGRAM 'command line';COPY TABLE TO PROGRAM 'command line';
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Enabling Checksums
Next
From: Fujii Masao
Date:
Subject: Re: [PATCH] Patch to compute Max LSN of Data Pages