Received: from unity.copyleft.no (unity.copyleft.no [212.71.72.23]) by mail.postgresql.org (8.11.3/8.11.1) with ESMTP id f2MEIpt67382 for ; Thu, 22 Mar 2001 09:18:51 -0500 (EST) (envelope-from johs@unity.copyleft.no) Received: from johs by unity.copyleft.no with local (Exim 3.12 #1) id 14g5vL-0006rd-00 for pgsql-sql@postgresql.org; Thu, 22 Mar 2001 15:18:47 +0100 Date: Thu, 22 Mar 2001 15:18:47 +0100 From: =?iso-8859-1?Q?Johannes_Gr=F8dem?= To: pgsql-sql@postgresql.org Subject: Foreign key referencing subclasses. Message-ID: <20010322151847.A26189@unity.copyleft.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Organization: Copyleft Software AS X-Archive-Number: 200103/446 X-Sequence-Number: 2114 Hi, it seems I can't have a foreign key that references some subclass. Postgres says it can't figure out what its primary key is. The primary key is defined in the superclass. I have something like this: CREATE TABLE resource_record( rrid SERIAL -- etc. ); CREATE TABLE soa_record( -- blah, blah ) INHERITS(resource_record); CREATE TABLE domain( -- ... soaid REFERENCES soa_record -- * ); * = This doesn't work. I can reference resource_record here, but I can not reference soa_record that way. Referencing resource_record* doesn't work either. -- johs