Re: [ANNOUNCE] == Postgres Weekly News - March 09 2008 ==
От | Karsten Hilbert |
---|---|
Тема | Re: [ANNOUNCE] == Postgres Weekly News - March 09 2008 == |
Дата | |
Msg-id | 20080311121556.GA4014@merkur.hilbert.loc обсуждение исходный текст |
Список | 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
В списке pgsql-hackers по дате отправления: