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

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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 15:31:25
Message-ID: CA+U5nML+qKX=Z=5WXNBs0mKdcNBNPWrmdDZB2hmMWA3oHFULbA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 14 November 2012 15:09, Fujii Masao <masao(dot)fujii(at)gmail(dot)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.

We can already do
INSERT table SELECT * FROM fdw;
with any logic for generating data lives inside an FDW or SRF.

If we want it in COPY we can have syntax like this...
COPY table FROM (SELECT * FROM fdw)

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2012-11-14 15:36:48 Re: Further pg_upgrade analysis for many tables
Previous Message Andrew Dunstan 2012-11-14 15:25:24 Re: Further pg_upgrade analysis for many tables