Re: Fix for psql core dumping on bad user - Mailing list pgsql-patches

From Peter Eisentraut
Subject Re: Fix for psql core dumping on bad user
Date
Msg-id Pine.LNX.4.30.0104181833040.762-100000@peter.localdomain
Whole thread Raw
In response to Re: Fix for psql core dumping on bad user  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
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


pgsql-patches by date:

Previous
From: "D. Hageman"
Date:
Subject: Re: Fix for psql core dumping on bad user
Next
From: "D. Hageman"
Date:
Subject: Re: Fix for psql core dumping on bad user