Re: [GENERAL] custom integrity check

2005-01-21 Thread Abdul-Wahid Paterson
Hi Michael, Thanks for that, it looks like it should work fine. I will give it ago :) Thanks, Abdul-Wahid On Fri, 21 Jan 2005 14:59:25 +0100, Michael Kleiser <[EMAIL PROTECTED]> wrote: > CREATE TABLE cats_items ( > cat_id int4 NOT NULL, item_id int4 NOT NULL, FOREIGN KEY (cat_id) > REFERENCE

Re: [GENERAL] custom integrity check

2005-01-21 Thread Michael Kleiser
CREATE TABLE cats_items ( cat_id int4 NOT NULL, item_id int4 NOT NULL, FOREIGN KEY (cat_id) REFERENCES cats (cat_id), FOREIGN KEY (item_id) REFERENCES items (item_id), PRIMARY KEY (cat_id, item_id) ); CREATE TABLE items_master_cats ( cat_id int4 PRIMARY KEY item_id int4

Re: [GENERAL] custom integrity check

2005-01-21 Thread Peter Eisentraut
Am Freitag, 21. Januar 2005 12:58 schrieb Abdul-Wahid Paterson: > I have the following table as a link table between my 'cats' table and > my 'items' table. Every item must have at least one cat and exactly > one 'master' cat. > > How can I create an integrity check to make sure that each item has

[GENERAL] custom integrity check

2005-01-21 Thread Abdul-Wahid Paterson
Hi, I have the following table as a link table between my 'cats' table and my 'items' table. Every item must have at least one cat and exactly one 'master' cat. How can I create an integrity check to make sure that each item has exactly one 'master' cat. CREATE TABLE cats_items ( cat_id