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

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

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> 'psql test </tmp/x' works fine, but 'psql -f /tmp/x test' hangs waiting
> for input from stdin. Why would we want STDIN to read from the terminal
> if all commands are being read from a file with -f?

Actually, that behavior is extremely useful. Consider
program-that-generates-data | psql -f somescript
The script can issue a COPY FROM STDIN to insert the data coming through
the pipe.

> I propose we just fix this and document it in the release notes.

I propose we not break existing applications. If we change it the way
you suggest, there'll be no way to do the above.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Keith Bottner 2004-02-10 15:15:07 Re: MS SQL features for new version
Previous Message Christopher Kings-Lynne 2004-02-10 14:54:08 Re: MS SQL features for new version

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-02-10 15:16:14 Re: [PATCHES] Current-stream read for psql's \copy
Previous Message Christopher Kings-Lynne 2004-02-10 14:51:12 Re: Patch to psql to allow SEARCH_PATH to be set from env