Thread: AW: [HACKERS] psql Week 1

AW: [HACKERS] psql Week 1

From
Zeugswetter Andreas IZ5
Date:
> * when \connect fails, it now keeps the previous connection (formerly
>   aborted program)

This was the behavior at one time, but it was regarded as very dangerous
and thus changed to the current behavior.

The problem was, that scripts would do things to the wrong database if a
connect failed.

The ultimate solution would be an unconnected state, where only
\connect or help commands would be accepted.

Andreas


Re: AW: [HACKERS] psql Week 1

From
Peter Eisentraut
Date:
On Oct 6, Zeugswetter Andreas IZ5 mentioned:

> > * when \connect fails, it now keeps the previous connection (formerly
> >   aborted program)
> 
> This was the behavior at one time, but it was regarded as very dangerous
> and thus changed to the current behavior.
> 
> The problem was, that scripts would do things to the wrong database if a
> connect failed.

See earlier response. Only in interactive mode. The idea was that a typo
should not bomb you out of the program.

> The ultimate solution would be an unconnected state, where only
> \connect or help commands would be accepted.

I had that idea, too, but that would open a whole new can of worms
code-wise. Can you guys out there comment if this feature would be
desirable?

-- 
Peter Eisentraut - peter_e@gmx.net
http://yi.org/peter-e/