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