Re: COPY Transform support - Mailing list pgsql-hackers

From Tom Lane
Subject Re: COPY Transform support
Date
Msg-id 635.1207664049@sss.pgh.pa.us
Whole thread Raw
In response to Re: COPY Transform support  (Dimitri Fontaine <dfontaine@hi-media.com>)
Responses Re: COPY Transform support  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Dimitri Fontaine <dfontaine@hi-media.com> writes:
> Le mardi 08 avril 2008, Tom Lane a écrit :
>> That's sufficiently covered by the proposal to allow a COPY FROM as a
>> table source within SELECT, no?

> Well, yes, the table source has text as datatypes and the select expression on 
> the column will call whatever function/cast etc to do the work. But that 
> opens the door to second class citizen storage solution for PostgreSQL, by 
> letting the user CREATE VIEW atop of it:

[ shrug... ]  I don't actually have a problem with that.  If we did want
to prohibit that, we'd have to somehow prohibit SRFs from reading files,
because you can do it today with any untrusted PL.

I note also that presumably COPY FROM 'file' would still be restricted
to superusers, and only COPY FROM STDIN would be available to those
without a license to shoot themselves in the foot.  So the opportunity
to do anything view-like would be restricted to adults(?) anyhow.

(One of the issues that'd have to be addressed to allow a table source
syntax is whether it's sane to allow multiple COPY FROM STDIN in a
single query.  If so, how does it work; if not, how do we prevent it?)
        regards, tom lane


pgsql-hackers by date:

Previous
From: tomas@tuxteam.de
Date:
Subject: Re: File system snapshots for multiple file systems
Next
From: Gregory Stark
Date:
Subject: Re: variables for tables and columns?