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

From Bruce Momjian
Subject Re: [PATCHES] Current-stream read for psql's \copy
Date
Msg-id 200402102141.i1ALf3E22737@candle.pha.pa.us
Whole thread Raw
In response to Re: [PATCHES] Current-stream read for psql's \copy  (Andrew Sullivan <ajs@crankycanuck.ca>)
List pgsql-hackers
Andrew Sullivan wrote:
> On Tue, Feb 10, 2004 at 12:33:10PM -0500, Bruce Momjian wrote:
> > 
> > What do people want to do with the current \copy behavior for stdin? 
> 
> I'd like to hear more discussion of Tom's argument about security
> before the decision is taken.

Tom's point is that you can feed SQL to psql via -f and have \copy input
come from psql's stdin, and you can't insert SQL into psql's stdin:
prog | psql -f commands.sql test

If commands.sql contains \copy, you can only specify copy data in
'prog', not actual SQL commands.  If you want to mix SQL commands and
\copy data in the same file, you have to use:
psql test < commands.sql

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

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