Search Postgresql Archives

Re: Two questions about "pg_constraint"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bryn Llewellyn <bryn@xxxxxxxxxxxx> 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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux