Re: [HACKERS] Re: your mail - Mailing list pgsql-hackers

From Thomas G. Lockhart
Subject Re: [HACKERS] Re: your mail
Date
Msg-id 3504AD02.12001E3A@alumni.caltech.edu
Whole thread Raw
In response to Re: your mail  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
> >   It would be a good idea, IMHO, that if psql is called alone (without
> > database nor any parameter), instead of try to connect to database 'user'
> > starts interactively without connection.  Then, simple calling "\c dbname"
> > would connect the user to the desired database.  What you think?
> >   Cheers,
>
> This seems like a good idea.  Any comments?

Of course :) I personally like the current default behavior, and I think that
some others find it similarly convenient. If the alternate behavior is
desirable for some, how about implementing a command line switch which would
change the default behavior to "don't open anything". Then, you can alias the
definition of psql to get what you want.

I actually had a patch of some sort which changed the behavior of "\c
unknownDB"; at the moment if a connection fails psql bails out. The patch left
the psql session open and connected to the previous database. That behavior
would be dangerous in some cases so we didn't apply it; going to an
"unconnected state" would be more helpful and less dangerous.

                                                     - Tom


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: your mail
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Heh, the disappearing problem!