Tom Lane writes:
> $ cat zscript
> \connect - testuser
> $ psql -f zscript regression
> psql:zscript:1: \connect: FATAL 1: user "testuser" does not exist
> $
>
> Nonetheless, the comment at the top of do_connect() says that it
> *should* terminate the program under these circumstances, so I'm not
> sure why it doesn't. Peter?
The comment is not correct. Failure in do_connect() in non-interactive
mode terminates the script. In the case of -f the program terminates
implicitly, but in case of \i you would return to the prompt (or the
containing \i).
--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter