Re: Two questions about "pg_constraint"

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Two questions about "pg_constraint"
Дата
Msg-id 1161776.1661374651@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Two questions about "pg_constraint"  (Bryn Llewellyn <bryn@yugabyte.com>)
Ответы Re: Two questions about "pg_constraint"  (Bryn Llewellyn <bryn@yugabyte.com>)
Список pgsql-general
Bryn Llewellyn <bryn@yugabyte.com> writes:
> *Question 1: why does "pg_constraint" have a "connamespace" column?*

You appear to be assuming that every pg_constraint entry is tied to
a table.  This isn't so.

(1) That catalog also carries check constraints for domains, which
are tied to types instead.  Yeah, you could imagine some rule like
"look in either pg_class or pg_type to find the schema", but it'd
be really painful.

(2) The SQL standard describes "assertions", which are global
check constraints that can affect multiple tables.  We don't
support those, and very possibly never will, but the pg_constraint
catalog is set up to support them.  Presumably they'd be stored
with conrelid and contypid both zero, so there would be no other
place to find out the assertion's schema.

I'm not entirely convinced that putting these two (or three) sorts
of objects in the same catalog was a great design.  However, that's
what we've got and changing it seems like more trouble than it'd be
worth.

            regards, tom lane



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

Предыдущее
От: Bryn Llewellyn
Дата:
Сообщение: Re: Two questions about "pg_constraint"
Следующее
От: Hillary Masha
Дата:
Сообщение: Re: Corrupted Postgresql Microsoft Binaries