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

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Mark Feit <mfeit+postgresql(at)notonthe(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Current-stream read for psql's \copy
Date: 2004-02-10 21:35:20
Message-ID: 200402102135.i1ALZKp21462@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:
>
> What do people want to do with the current \copy behavior for stdin?
> Right now if you supply a file name with queries using psql -f, the copy
> input is read from the terminal, not from the file.

Actually, I was wrong. Right now \copy reads from psql's stdin, not
always the terminal. It doesn't read from the same descriptor it gets
its SQL commands, unless they are the same as psql's stdin, like:

psql test < commands.sql

You could make STDIN be the command stream, and add 'psqlstdin' for
psql's stdin, but it seems like a very little used feature. It doesn't
seem worth documenting it, let alone adding code to allow it.

I assume \copy is designed primarily to allow reading from _local_ files
rather than only files that exist on the database server, as COPY
requires.

--
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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-02-10 21:41:03 Re: [PATCHES] Current-stream read for psql's \copy
Previous Message Rod Taylor 2004-02-10 20:40:31 Re: MS SQL features for new version

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-02-10 21:41:03 Re: [PATCHES] Current-stream read for psql's \copy
Previous Message Neil Conway 2004-02-10 20:27:31 Re: Patch to psql to allow SEARCH_PATH to be set from env