Re: enhanced error fields - Mailing list pgsql-hackers

From anarazel@anarazel.de
Subject Re: enhanced error fields
Date
Msg-id 1d25dc31-e98e-47a0-a91a-e884619f7fbc@email.android.com
Whole thread Raw
In response to Re: enhanced error fields  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: enhanced error fields
List pgsql-hackers

Robert Haas <robertmhaas@gmail.com> schrieb:

>On Sat, Dec 29, 2012 at 4:30 PM, Peter Geoghegan
><peter@2ndquadrant.com> wrote:
>> Ascertaining the identity of the object in question perfectly
>> unambiguously, so that you can safely do something like lookup a
>> comment on the object, seems like something way beyond what I'd
>> envisioned for this feature. Why should the comment be useful in an
>> error handler anyway? At best, that seems like a nice-to-have extra
>to
>> me. The vast majority are not even going to think about the ambiguity
>> that may exist. They'll just write:
>>
>> if (constraint_name == "upc")
>>     MessageBox("That is not a valid barcode.");
>
>The people who are content to do that don't need this patch at all.
>They can just apply a regexp to the message that comes back from the
>server and then set constraint_name based on what pops out of the
>regex.  And then do just what you did there.

Easier said than done if you're dealing with pg installations with different lc_messages...

Andres

---
Please excuse the brevity and formatting - I am writing this on my mobile phone.



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: enhanced error fields
Next
From: Boszormenyi Zoltan
Date:
Subject: Re: Proposal for Allow postgresql.conf values to be changed via SQL [review]