Re: enhanced error fields

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: enhanced error fields
Дата
Msg-id 15808.1359485462@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: enhanced error fields  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: enhanced error fields  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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.

Here's an updated patch (code only, sans documentation) that fixes that
and adds some other refactoring that I thought made for improvements.
I think this is ready to commit except for the documentation.

I eventually concluded that the two ALTER DOMAIN call sites in
typecmds.c should report the table/column name (with errtablecol),
even though in principle the auxiliary info ought to be about the
domain.  The reason is that the name of the domain is nearly useless
here --- you probably know it already, if you're issuing an ALTER for
it.  In fact, we don't even bother to provide the name of the domain
at all in either human-readable error message.  On the other hand,
the location of the offending value could be useful info.  So I think
usefulness should trump principle there.

            regards, tom lane


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: enhanced error fields
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Tolerate timeline switches while "pg_basebackup -X fetch" is run