Re: enhanced error fields - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: enhanced error fields
Date
Msg-id 20121229225704.GG16126@tamriel.snowman.net
Whole thread Raw
In response to Re: enhanced error fields  (Peter Geoghegan <peter@2ndquadrant.com>)
Responses Re: enhanced error fields  (Peter Geoghegan <peter@2ndquadrant.com>)
List pgsql-hackers
Peter,

* Peter Geoghegan (peter@2ndquadrant.com) wrote:
> if (constraint_name == "upc")
>     MessageBox("That is not a valid barcode.");

So they'll quickly realize that a lookup-table based on constraint name
would be useful, create it, and then have a primary key on it to make
sure that they don't have any duplicates.  Of course, this is all
duplicating what we're *already* keeping track of, except that method
won't be consistent with the catalog and they could end up with a single
entry in their table which corresponds to multiple actual constraints in
the system and begin subtly returning errors that don't make any sense
to the end user.

That's exactly the kind of subtly broken situation that I would hope
we'd try to keep them from getting into.

I'd almost rather return the OID and provide some lookup functions.
Thanks,
    Stephen

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: enhanced error fields
Next
From: Peter Geoghegan
Date:
Subject: Re: enhanced error fields