Re: [PATCHES] Current-stream read for psql's \copy - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] Current-stream read for psql's \copy
Date
Msg-id 17339.1076434592@sss.pgh.pa.us
Whole thread Raw
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I will do it by vote, not because _I_ decide it is unintuitive.  And I
> don't have to talk _you_ into it, just a majority of developers.

[shrug...] Put it to a vote if you want; I feel sure you will lose.

There is another argument in favor of being able to read COPY data from
stdin (ie, not from the command script), which is that it is a security
feature that can help prevent SQL-injection attacks.  In the example ofdata-source-program | psql -f script
the upstream program *cannot* insert any SQL commands, it can only
source data that will go into exactly the table the script specifies.
The workaround you proposed of having the upstream issue COPY for itself
is insecure; it's quite analogous to allowing a user to enter unquoted
data into a SQL command string.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andreas Pflug
Date:
Subject: Re: MS SQL features for new version
Next
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] Current-stream read for psql's \copy