Re: psql -1 -f - busted - Mailing list pgsql-bugs

From Robert Haas
Subject Re: psql -1 -f - busted
Date
Msg-id 603c8f070911270411s27f3efcbjd9dd2da631e02bda@mail.gmail.com
Whole thread Raw
In response to Re: psql -1 -f - busted  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: psql -1 -f - busted
List pgsql-bugs
On Fri, Nov 27, 2009 at 1:42 AM, Peter Eisentraut <peter_e@gmx.net> wrote:
> On tor, 2009-11-26 at 22:59 -0500, Robert Haas wrote:
>> ISTM that if you run psql with "-f -", you shouldn't expect to get an
>> interactive shell. =A0Rather, you should expect psql to do whatever it
>> normally does when given -f somefilename, except using stdin rather
>> than the file. =A0After all, you could have left out -f altogether if
>> you'd wanted the interactive behavior. =A0But then IJWH.
>
> But by that logic, psql < file should also set interactive mode.

Those two cases are not symmetrical.  If you're reading from something
other than a terminal, you certainly don't want interactive mode.  If
you ARE reading from a terminal, you might nevertheless want
non-interactive mode.  And you CERTAINLY might want -1 when reading a
pipe, as when you do this:

ssh otherhost pg_dump | psql -1 -f -

Currently, this silently fails to deliver the expected behavior.

...Robert

pgsql-bugs by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: BUG #5216: pgFouine 1.1 not working correctly, when LC_MESSAGES is "es_ES.UTF-8"
Next
From: Robert Haas
Date:
Subject: Re: BUG #5207: unable to start postgresql server services