Received: from femail45.sdc1.sfba.home.com ([24.254.60.39]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8B84v737223 for ; Tue, 11 Sep 2001 04:05:04 -0400 (EDT) (envelope-from kway@overtone.org) Received: from bean.overtone.org ([24.249.254.100]) by femail45.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with ESMTP id <20010911080453.RXKP4591.femail45.sdc1.sfba.home.com@bean.overtone.org> for ; Tue, 11 Sep 2001 01:04:53 -0700 Received: by bean.overtone.org (Postfix, from userid 1001) id D68095B5F0; Tue, 11 Sep 2001 08:04:52 +0000 (GMT) Date: Tue, 11 Sep 2001 08:04:52 +0000 From: Kevin Way To: pgsql-sql@postgresql.org Subject: table inheritance and foreign key troubles Message-ID: <20010911080452.A76783@bean.overtone.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Archive-Number: 200109/49 X-Sequence-Number: 4695 I'm having a little trouble with some inherited tables and a foreign key. Here's a simplified case, to show the trouble. CREATE TABLE node ( node_id SERIAL NOT NULL, name TEXT NOT NULL, PRIMARY KEY (node_id) ); -- works just fine CREATE TABLE users ( email TEXT NOT NULL ) INHERITS (node); -- so far so good.... CREATE TABLE item ( reason TEXT NOT NULL, author_id INT NOT NULL REFERENCES users (node_id) ) INHERITS (node); ERROR: UNIQUE constraint matching given keys for referenced table "users" not found Does this operation just require differing syntax, because the referenced field is inherited from another table, or is this not possible? Kevin Way