pg.ddx.io pgsql-sql@postgresql.org mailing list archivehelp / color / mirror / Atom feed
Integrity reference and inheritance 2+ messages / 2 participants [nested] [flat]
* Integrity reference and inheritance @ 2001-06-10 04:57 Christophe Labouisse <christophe@labouisse.org> 0 siblings, 1 reply; 2+ messages in thread From: Christophe Labouisse @ 2001-06-10 04:57 UTC (permalink / raw) To: pgsql-sql I wanted to build the following schema : - one "generic" document table with a column doc_id ; - a couple of "specific" document tables inheriting from doc ; - a table refering a document by it's id with and integrity constraint on it. In SQL : CREATE TABLE doc ( doc_id serial PRIMARY KEY, ); CREATE TABLE lexique ( ) INHERITS (doc); CREATE TABLE word_doc ( id serial PRIMARY KEY, doc_id int4 NOT NULL CONSTRAINT word_doc_doc_id_ref REFERENCES doc ON DELETE CASCADE, ); What I tried to do next is to insert a new "lexique" entry, and then a bunch of "word_doc" rows refering this entry. The last part fails with a constraint violation this is quite normal since the trigger in backend/utils/adt/ri_triggers.c makes a "SELECT FROM ONLY". What should I do ? Should I consider another way to do what I want, rewrite a trigger to replace the system one ? -- Le cinéma en Lumière : http://www.lumiere.org/ Fingerprint : 4721 651D D309 B302 93E4 5D73 CC52 DF3A E7C7 86CF ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Integrity reference and inheritance @ 2001-06-12 22:31 Christophe Labouisse <labouiss@cybercable.fr> parent: Christophe Labouisse <christophe@labouisse.org> 0 siblings, 0 replies; 2+ messages in thread From: Christophe Labouisse @ 2001-06-12 22:31 UTC (permalink / raw) To: pgsql-sql Sorry for the double post, I messed up in my addresses. ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-06-12 22:31 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2001-06-10 04:57 Integrity reference and inheritance Christophe Labouisse <christophe@labouisse.org> 2001-06-12 22:31 ` Christophe Labouisse <labouiss@cybercable.fr>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox