For tracking of Foreign Keys, Check constraints, and maybe NULL / NOT
NULL (specific type of check constraint) I intend to create (as per
contype ('c'heck, 'f'oreign key, ???)
conkey (int2vector of columns of relid, like pg_index.indkey)
connum int4 -- unique identifying constraint number for the relation
Dependencies would be on conrelid, and connum in pg_depend. If each
constraint has a unique number for the relation OIDs aren't required
here. Much like pg_attribute.
pg_class.relchecks would change to mean relconstraints, though I wont
change the column name.
A view to pg_relcheck would be created.
End result? Foreign Keys will be tracked and restricted / cascaded
through via pg_depend code (see patches archive in April). This would
knock several items off the TODO list.
I'm not exactly sure how to find out what columns a check constraint
depends on, but I'm sure I'll figure that out sooner or later.
Any thoughts or suggestions? Is there any reason to allow a check in
a namespace other than the relation it's tied to? Spec seems to allow
that, but is it actually useful?
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2002-04-26 02:32:14|
|Subject: Re: What is wrong with hashed index usage? |
|Previous:||From: Curt Sampson||Date: 2002-04-26 02:27:17|
|Subject: Re: Sequential Scan Read-Ahead |