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 26216.1347546321@sss.pgh.pa.us
Whole thread Raw
In response to WIP patch: add (PRE|POST)PROCESSOR options to COPY  ("Etsuro Fujita" <fujita.etsuro@lab.ntt.co.jp>)
Responses Re: WIP patch: add (PRE|POST)PROCESSOR options to COPY  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Re: WIP patch: add (PRE|POST)PROCESSOR options to COPY  (Craig Ringer <ringerc@ringerc.id.au>)
List pgsql-hackers
"Etsuro Fujita" <fujita.etsuro@lab.ntt.co.jp> writes:
> I'd like to add the following options to the SQL COPY command and the psql \copy
> instruction:

>     * PREPROCESSOR: Specifies the user-supplied program for COPY IN.  The data
> from an input file is preprocessed by the program before the data is loaded into
> a postgres table.
>     * POSTPROCESSOR: Specifies the user-supplied program for COPY OUT.  The data
> from a postgres table is postprocessed by the program before the data is stored
> in an output file.

The proposed patch causes the external processor programs to execute
with the privileges of the database server, which seems like a pretty
horrid idea.  At the very least this would imply limiting use of the
feature to superusers, which greatly restricts its use-case.

I think it would be a lot better if this were designed so that the
processor programs executed on client side.  Which would probably make
it not a COPY patch at all, but something in psql.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Kohei KaiGai
Date:
Subject: Re: [v9.3] writable foreign tables
Next
From: Tom Lane
Date:
Subject: Re: [v9.3] writable foreign tables