Re: [PATCHES] Current-stream read for psql's \copy

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Current-stream read for psql's \copy
Date: 2004-02-10 21:41:03
Message-ID: 200402102141.i1ALf3E22737@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-02-10 21:50:49 Re: [HACKERS] PITR Dead horse?
Previous Message Bruce Momjian 2004-02-10 21:35:20 Re: [PATCHES] Current-stream read for psql's \copy

Browse pgsql-patches by date

  From Date Subject
Next Message Scott Goodwin 2004-02-10 22:04:56 Re: Patch to psql to allow SEARCH_PATH to be set from env
Previous Message Bruce Momjian 2004-02-10 21:35:20 Re: [PATCHES] Current-stream read for psql's \copy