Re: enhanced error fields

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Subject: Re: enhanced error fields
Date: 2012-12-29 22:57:04
Message-ID: 20121229225704.GG16126@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter,

* Peter Geoghegan (peter(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2012-12-29 23:29:52 Re: enhanced error fields
Previous Message Peter Geoghegan 2012-12-29 21:31:49 Re: enhanced error fields