Re: enhanced error fields - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: enhanced error fields
Date
Msg-id CAEYLb_X8+hQqPW2vUBP=htUTP8KTgOkCOG+s59shvrEfdOpq-g@mail.gmail.com
Whole thread Raw
In response to Re: enhanced error fields  (Stephen Frost <sfrost@snowman.net>)
Responses Re: enhanced error fields  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
On 29 December 2012 22:57, Stephen Frost <sfrost@snowman.net> wrote:
> 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.

I don't find that terribly likely. There is nothing broken about the
example. It's possible to misuse almost anything.

In order for the problem you describe to happen, the user would have
to ignore the warning in the documentation about constraint_name's
ability to uniquely identify something, and then have two constraints
in play at the same time with the same name but substantively
different. That seems incredibly unlikely.

Maybe you think that users cannot be trusted to take that warning on
board, but then the same user could not be trusted to heed another
warning about using a constraint_schema in the lookup table primary
key.

This whole lookup table idea presupposes that there'll only ever be
one error message per constraint in the entire application. That
usually isn't true for all sorts of reasons, in my experience.

-- 
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: enhanced error fields
Next
From: Stephen Frost
Date:
Subject: Re: enhanced error fields