Re: pg_constraint

Поиск
Список
Период
Сортировка
От Rod Taylor
Тема Re: pg_constraint
Дата
Msg-id 04c701c1ed18$74c26720$ad02000a@jester
обсуждение исходный текст
Ответ на Re: pg_constraint  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Список pgsql-hackers
> > For tracking of Foreign Keys, Check constraints, and maybe NULL /
NOT
> > NULL (specific type of check constraint) I intend to create (as
per
> > suggestion) pg_constraint.
>
> Hmmm...I don't see the need at all for NOT NULL constraint tracking.
The
> spec doesn't seem to require it and we do not have names for them
anyway.
> Even if they were given names, it'd be pointless, as there's only
one per
> column.

Correct me if I'm wrong, but aren't NOT NULL constraints a shortform
of the similar CHECK constraint (according to spec which I don't have
infront of me).  I've been debating combining the 2 and allowing names
on them, but won't do this yet. CHECK (VALUE NOT NULL) would mark the
pg_attribute column and assign the name.

> Primary keys and unique keys are SQL constraints - are you going to
bother
> tracking them as well or leave them in the current format?  Maybe
you could
> do it with a view or something.

> Why not just create a pg_references table and leave pg_relcheck as
is?

relcheck needs changes anyway.  It needs to track the specific columns
that it depends on, rather than simply the table.  This is for reasons
of DROP COLUMN.  Last thing you want is a bad check constraint after
that ;)  The other reason is that they're supposed to be in the same
namespace (which makes sense) and having each constraint in its own
table would be silly.

Of note, the above table should also have immediate, and deferrable
bools attached to it.

I debated about the primary / unique keys, but indicies seem to do a
good enough job with those.






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

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: WAL -> Replication
Следующее
От: mlw
Дата:
Сообщение: Re: Block size: 8K or 16K?