From:
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To:
Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com>
Cc:
Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>,
"anarazel(at)anarazel(dot)de" <andres(at)anarazel(dot)de>,
Robert Haas <robertmhaas(at)gmail(dot)com>,
Stephen Frost <sfrost(at)snowman(dot)net>,
PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>,
Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Subject:
Re: enhanced error fields
Date:
2013-01-29 04:08:33
Message-ID:
14942.1359432513@sss.pgh.pa.us (view raw or flat )
Thread:
2012-05-09 13:33:01 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-05-22 13:46:56 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-07-02 14:19:56 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-07-02 21:52:17 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-07-03 06:13:21 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-07-03 16:35:51 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-07-06 05:57:32 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-07-03 16:26:57 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-07-03 16:48:51 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-07-03 16:59:40 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-07-03 17:26:04 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-07-03 16:36:51 from Andres Freund <andres(at)2ndquadrant(dot)com>
2012-07-03 19:48:55 from Matthew Woodcraft <matthew(at)woodcraft(dot)me(dot)uk>
2012-07-04 09:33:48 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-07-04 15:34:14 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-07-04 17:30:25 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-07-04 18:10:14 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-07-05 16:41:38 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-07-07 00:42:48 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-07-07 12:57:35 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-07-10 18:56:40 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-07-10 19:28:18 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-07-10 19:54:59 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-07-10 20:26:12 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-07-10 21:14:23 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-07-10 22:39:07 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-07-18 18:13:09 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-07-23 10:47:57 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-07-23 11:03:42 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-07-23 14:23:35 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-07-23 14:37:56 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-08-20 13:09:38 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-10-08 14:03:03 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-10-10 13:56:46 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-10-11 16:56:36 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-10-12 19:27:46 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-10-13 18:45:42 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-10-20 19:10:08 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-10-21 07:59:42 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-10 20:28:51 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-12-10 20:52:32 from "David Johnston" <polobo(at)yahoo(dot)com>
2012-12-10 21:23:14 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-12-11 13:05:30 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-28 20:30:58 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2012-12-11 13:01:38 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-21 18:52:56 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-12-28 11:44:42 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-28 14:00:50 from Stephen Frost <sfrost(at)snowman(dot)net>
2012-12-28 15:09:19 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-28 15:57:05 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-12-28 18:21:50 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-12-28 18:40:36 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-28 19:03:14 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-12-28 19:23:28 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-28 19:33:37 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-12-28 19:55:52 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-28 20:34:39 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-12-28 20:40:44 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-28 20:46:55 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-12-28 20:55:14 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-28 20:34:23 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2012-12-28 20:40:25 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-12-28 20:40:48 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2012-12-28 20:59:26 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-12-28 23:35:02 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-12-29 05:04:03 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-29 16:07:58 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-12-29 16:45:35 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-12-29 16:58:40 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-29 16:45:47 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-29 17:43:56 from Stephen Frost <sfrost(at)snowman(dot)net>
2012-12-29 18:16:49 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-12-29 18:30:04 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-29 18:37:12 from Stephen Frost <sfrost(at)snowman(dot)net>
2012-12-29 19:24:07 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-12-29 19:35:57 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-29 19:56:06 from Stephen Frost <sfrost(at)snowman(dot)net>
2012-12-29 19:57:38 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-29 20:00:51 from Stephen Frost <sfrost(at)snowman(dot)net>
2012-12-29 20:07:01 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-29 20:18:07 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-12-29 20:49:12 from Stephen Frost <sfrost(at)snowman(dot)net>
2012-12-29 21:10:10 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-29 21:15:21 from Stephen Frost <sfrost(at)snowman(dot)net>
2012-12-29 21:24:43 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-29 21:31:49 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2013-01-13 06:13:34 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2013-01-13 10:44:12 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2013-01-13 17:39:01 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-12-29 21:30:53 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-12-29 22:57:04 from Stephen Frost <sfrost(at)snowman(dot)net>
2012-12-29 23:29:52 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-12-30 02:01:04 from Stephen Frost <sfrost(at)snowman(dot)net>
2012-12-30 02:48:34 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-12-30 03:32:45 from Stephen Frost <sfrost(at)snowman(dot)net>
2012-12-30 04:21:31 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-12-30 04:47:46 from Stephen Frost <sfrost(at)snowman(dot)net>
2012-12-30 06:34:00 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-30 14:37:30 from Stephen Frost <sfrost(at)snowman(dot)net>
2012-12-30 14:57:15 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2013-01-04 17:12:20 from Robert Haas <robertmhaas(at)gmail(dot)com>
2013-01-04 17:19:09 from "anarazel(at)anarazel(dot)de" <andres(at)anarazel(dot)de>
2013-01-04 18:07:34 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-04 22:33:02 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2013-01-05 16:56:30 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2013-01-05 17:48:08 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2013-01-05 18:06:57 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2013-01-06 20:39:24 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2013-01-26 22:36:51 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-27 03:08:54 from Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com>
2013-01-27 07:39:03 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2013-01-27 18:57:07 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-27 20:02:01 from Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com>
2013-01-27 20:53:50 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-28 18:00:40 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-28 19:41:15 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2013-01-28 20:01:46 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-28 20:04:02 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2013-01-29 04:08:33 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-29 14:20:34 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2013-01-29 18:51:02 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-29 22:23:39 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-27 20:24:19 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-29 17:00:46 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2013-01-27 07:32:07 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2013-01-28 21:33:50 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2013-01-28 21:56:16 from Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com>
2013-01-29 17:05:42 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2013-01-29 17:13:52 from Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com>
2013-01-29 17:56:42 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2013-01-04 17:10:16 from Robert Haas <robertmhaas(at)gmail(dot)com>
2013-01-04 22:37:50 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2013-01-05 16:55:03 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-12-28 18:09:17 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-10-24 22:29:58 from Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
2012-10-24 23:20:51 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2012-10-25 03:17:53 from Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Lists:
pgsql-hackers
I wrote:
> Rather what we've got is that constraints are uniquely named among
> those associated with a table, or with a domain. So the correct
> unique key for a table constraint is table schema + table name +
> constraint name, whereas for a domain constraint it's domain schema +
> domain name + constraint name. The current patch provides sufficient
> information to uniquely identify a table constraint, but not so much
> domain constraints. Should we fix that? I think it'd be legitimate
> to re-use SCHEMA_NAME for domain schema, but we'd need a new nonstandard
> field DOMAIN_NAME (or maybe better DATATYPE_NAME) if we want to fix it.
I have hacked up the code (but not yet the documentation) to support
this, but I found out that there's at least one place where this
definition of the field semantics is a bit awkward. The issue is that
this definition presupposes that we want to complain about a table or
a domain, never both, because we're overloading both the SCHEMA_NAME
and CONSTRAINT_NAME fields for both purposes. This is annoying in
validateDomainConstraint(), where we know the domain constraint that
we're complaining about and also the table/column containing the bad
value. We can't fill in both TABLE_NAME and DATATYPE_NAME because
they both want to set SCHEMA_NAME, and perhaps not to the same value.
Since the error report is about a domain constraint, I don't have a big
problem deciding that the domain has to win this tug-of-war. And it
could easily be argued that if we had separate fields and filled in
both, an application could get confused about whether we meant a table
constraint or a domain constraint. (As submitted, the patch would
definitely have made it look like we were complaining about a table
constraint.) But it's still annoying that we can't represent all the
info that is in the human-readable message.
I'm not sure we should allow corner cases like this to drive the design;
but if anyone has an idea about a cleaner way, let's hear it.
regards, tom lane
In response to
Responses
pgsql-hackers by date
Next :From: David RowleyDate: 2013-01-29 05:01:47
Subject : Re: Hm, table constraints aren't so unique as all that
Previous :From : Noah MischDate : 2013-01-29 03:48:37
Subject : Re: Re: Doc patch making firm recommendation for settingthe value of commit_delay