Re: enhanced error fields

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Geoghegan <peter(dot)geoghegan86(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-28 19:41:15
Message-ID: CAFj8pRCCCBOHnDzAROQGU+wdqZEKv4=RWTXt3YPjEUeqbpk1cg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2013/1/28 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> A couple more things about this patch ...
>
> I went back through the thread and reviewed all the angst about which
> fields to provide, especially whether we need CONSTRAINT_SCHEMA.
> I agree with the conclusion that we don't. It's in the spec because
> the spec supposes that CONSTRAINT_SCHEMA+CONSTRAINT_NAME is a unique
> identification for a constraint --- but it is not in Postgres, for
> historical reasons that we aren't going to revisit in this patch.
> 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.
> Do we want to add that now?

should be for me.

one question - what do you thing about marking proprietary field with
some prefix - like PG_DOMAIN_NAME ?

>
> If we do fix this, either now or later, it's going to require some small
> support function very much like errtable() to perform the catalog
> lookups for a datatype and set the ErrorData fields. The thought of
> dropping such a thing into relerror.c exposes the fact that that
> "module" isn't actually very modular. We could choose a different name
> for the file but it'd still be pretty questionable as to what its
> boundaries are. So I'm a bit inclined to drop relerror.c as such, and
> go back to the early design that put errtable() and friends in
> relcache.c. The errconstraint() function, not being specific to either
> rels or datatypes, perhaps really does belong in elog.c.
>

+1

Pavel

> Thoughts?
>
> regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2013-01-28 20:00:37 Re: proposal - assign result of query to psql variable
Previous Message Francois Tigeot 2013-01-28 18:49:20 Re: SYSV shared memory vs mmap performance