Re: [HACKERS] Foreign keys and indexes.

2002-04-21 Thread Tom Lane
"Rod Taylor" <[EMAIL PROTECTED]> writes: > Is everyone Ok with the above? Or do we go about making an pg_fkey > type table for tracking this stuff? In general there ought to be a pg_constraint table that records all types of constraints (not only foreign keys). We blew it once already by making

Re: [HACKERS] Foreign keys and indexes.

2002-04-20 Thread Rod Taylor
> Of course, since Trigger on A depends on A we also have > Trigger on A -> B.id Should read: Trigger on A -> relation A Triggers depend on relation which owns it :) ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send a

[HACKERS] Foreign keys and indexes.

2002-04-20 Thread Rod Taylor
In order to apply a dependency of foreign keys against a column set the most obvious way to go is via the unique index which in turn depends on the expected columns. A(id) -> B(id) A.id -> Foreign key -> Index on B.id -> B.id If B.id is dropped it'll cascade forward. The trick? Foreign keys