Tom Lane writes:
> > Perhaps the socket blew up and psql reconnected to template1?
>
> I think psql will attempt automatic reconnection after a connection
> failure in some cases, but AFAIK it should always reconnect to the last
> database in use. (Hmm, but if it had originally connected to template1,
> and the \connect to hmzbook was inside a script, maybe the reconnect
> would go to template1? Peter, can you give us any insight on the
> possible behaviors there?)
psql only attempts to reconnect to anything if the session is interactive.
Otherwise psql exits right there if the connection went bad (independent
of ON_ERROR_STOP).
--
Peter Eisentraut peter_e@gmx.net