Re: [ANNOUNCE] == Postgres Weekly News - March 09 2008 ==

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [ANNOUNCE] == Postgres Weekly News - March 09 2008 ==
Date: 2008-03-11 12:15:56
Message-ID: 20080311121556.GA4014@merkur.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-announce pgsql-hackers

On Mon, Mar 10, 2008 at 12:16:52AM -0700, David Fetter wrote:

> - Add to TODO: "Add SQLSTATE severity to PGconn return status."

Yes, please. I have recently been discussing this with
Andreas, Bernd and Peter at Linuxtage Chemnitz.

In GNUmed we want to be able to distinguish connection
errors due to faulty credentials (not *which* part of the
credentials only *whether* credentials are the cause) from
other errors in order to react meaningfully in the program.

Currently, PGconn only returns CONNECTION_BAD or _OK and an
error message. The error message already says things like

FATAL: password authentication failed for user ...

so the level of information I want is already there.
However, our code would need to parse the message to detect
this state. This is a problem because the above message is
translated according to the local users LC_MESSAGE setting.

IOW, it'd be really helpful if the error state communicated
by the message in a way independant of the wording of the
message itself. Now, a technically proper way might be to
change the API to return a status along with the message. A
hacky but easy-to-implement solution might be to simply
append or prepend a fixed, non-translated string to the
message.

Thanks,
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

In response to

Browse pgsql-announce by date

  From Date Subject
Next Message Mark Wong 2008-03-13 06:11:49 PostgreSQL top (ptop) 3.6.2-beta1 released
Previous Message Dimitri Fontaine 2008-03-10 16:12:26 pgloader ETL releases version 2.3.0, implementing parallel loading

Browse pgsql-hackers by date

  From Date Subject
Next Message David BOURIAUD 2008-03-11 12:31:42 Idea about sql command create table like
Previous Message Heikki Linnakangas 2008-03-11 11:00:22 Re: LISTEN vs. two-phase commit