Re: psql -1 -f - busted

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: psql -1 -f - busted
Date: 2009-11-27 12:11:44
Message-ID: 603c8f070911270411s27f3efcbjd9dd2da631e02bda@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Nov 27, 2009 at 1:42 AM, Peter Eisentraut <peter_e(at)gmx(dot)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.  Rather, you should expect psql to do whatever it
>> normally does when given -f somefilename, except using stdin rather
>> than the file.  After all, you could have left out -f altogether if
>> you'd wanted the interactive behavior.  But 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2009-11-27 12:25:01 Re: BUG #5207: unable to start postgresql server services
Previous Message Jaime Casanova 2009-11-27 10:17:00 Re: BUG #5216: pgFouine 1.1 not working correctly, when LC_MESSAGES is "es_ES.UTF-8"