Re: [PATCHES] Slightly better testing for pg_ctl(1)'s -w...

2004-10-15 Thread Bruce Momjian
Patch applied. Thanks. I simplified your test and made the error message a #define that is now used consistently in all places. Patch attached. --- Sean Chittenden wrote: pg_ctl(1)'s -w option works well if the default

Re: [PATCHES] Slightly better testing for pg_ctl(1)'s -w...

2004-10-14 Thread Bruce Momjian
Added to TODO: * Allow libpq to access SQLSTATE so pg_ctl can test for connection failure This would be used for checking if the server is up. --- Sean Chittenden wrote: ... it should have a SQLSTATE assigned, so

Re: [PATCHES] Slightly better testing for pg_ctl(1)'s -w...

2004-10-11 Thread Sean Chittenden
pg_ctl(1)'s -w option works well if the default user can automatically authenticate without any user intervention. The attached patch checks the error message to see if it's asking for a password. The theory being that if it's asking for a password, the backend is up. I'm not entirely happy

Re: [PATCHES] Slightly better testing for pg_ctl(1)'s -w...

2004-10-11 Thread Sean Chittenden
... it should have a SQLSTATE assigned, so you could check for ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION ... Ok, I've read over the code a little bit... it doesn't seem like there's an obvious way to get the error code via libpq(3). Hmmm ... I was thinking of PQresultErrorField, but you don't