Re: BUG #3059: psql to 'postgres' shortcut - Mailing list pgsql-bugs

From Raymond Naseef
Subject Re: BUG #3059: psql to 'postgres' shortcut
Date
Msg-id 339874.83662.qm@web53608.mail.yahoo.com
Whole thread Raw
In response to BUG #3059: psql to 'postgres' shortcut  ("Raymond Naseef" <raymondnaseef@yahoo.com>)
List pgsql-bugs
Dear Team,

I checked the shortcut and was unable to find any note about "close on exit=
" or anything like that.  The .bat method sounds wonderful, and I would app=
reciate such a change to make the product a little more responsive.

Thank you for your consideration and time,

Raymond Naseef


P.S. I apologize if my email were not being sent properly.  I will pay clos=
e attention to this going forward.


----- Original Message ----
From: Bruce Momjian <bruce@momjian.us>
To: Magnus Hagander <magnus@hagander.net>
Cc: Phil Frost <phil@macprofessionals.com>; Raymond Naseef <raymondnaseef@y=
ahoo.com>; pgsql-bugs@postgresql.org
Sent: Tuesday, February 27, 2007 2:08:38 PM
Subject: Re: [BUGS] BUG #3059: psql to 'postgres' shortcut


Magnus Hagander wrote:
> On Tue, Feb 27, 2007 at 09:06:17AM -0500, Phil Frost wrote:
> > Hrm...I haven't used windows for a while now, but isn't there an=20=20
> > option on all shortcuts to command-line programs to make the shell=20=
=20
> > pause on exit? It is something like, right click on shortcut, select=20=
=20
> > 'properties', uncheck 'close shell on exit'. It would seem this would=
=20=20
> > solve the problem of not being able to see errors, while also not=20=20
> > adding a pause for programs which execute psql.bat directly.
>=20
> Yes, that is exactly the point -it would be very annoying in all other
> cases, as Bruce pointed out.
>=20
> I guess another option would be to add a commandline option to psql to
> pause on error, but I don't think that's going to fly ;-)

I just ran a test on Unix and found psql exits with '2' if the password
fails.  In fact, looking at the psql sources I see:
=20=20=20=20
    #ifndef EXIT_SUCCESS
    #define EXIT_SUCCESS 0
    #endif
=20=20=20=20
    #ifndef EXIT_FAILURE
    #define EXIT_FAILURE 1
    #endif
=20=20=20=20
    #define EXIT_BADCONN 2
=20=20=20=20
    #define EXIT_USER 3

Notice EXIT_BADCONN.  So, what if we call psql from a batch file, and
check for a '2' exit status, and then issue a pause for only that case?

--=20
  Bruce Momjian  <bruce@momjian.us>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +


=20
___________________________________________________________________________=
_________
It's here! Your new message!=20=20
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/=

pgsql-bugs by date:

Previous
From: "Michael Witten"
Date:
Subject: BUG #3087: Endiannes, of all things
Next
From: "Andrew Rass"
Date:
Subject: BUG #3092: character varying and integer cannot be matched