On Thu, Oct 22, 2009 at 2:42 PM, Stephen Frost <sfrost@snowman.net> wrote:
> =A0-1 appears to be ignored when '-f -' is set.
I've been bitten by this, too. It appears that "-f -" is in general
equivalent to not specifying "-f" at all. In startup.c we have a test
for:
options.action =3D=3D ACT_FILE && strcmp(options.action_string, "-") !=3D 0
I suppose we could change it to:
options.action =3D=3D ACT_FILE && (strcmp(options.action_string, "-") !=3D 0
|| pset.notty)
But I sort of think it should just be:
options.action =3D=3D ACT_FILE
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.
...Robert