Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g1JGrrE22025; Tue, 19 Feb 2002 11:53:53 -0500 (EST) (envelope-from sszabo@megazone23.bigpanda.com) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 74FA4D5FD; Tue, 19 Feb 2002 08:53:54 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 6A7225BF9; Tue, 19 Feb 2002 08:53:54 -0800 (PST) Date: Tue, 19 Feb 2002 08:53:54 -0800 (PST) From: Stephan Szabo To: "Kancha ." Cc: , Subject: Re: [SQL] inheritance and foreign key In-Reply-To: <20020219151704.13896.qmail@web14908.mail.yahoo.com> Message-ID: <20020219085215.S86265-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200202/760 X-Sequence-Number: 20776 On Tue, 19 Feb 2002, Kancha . wrote: > I'm a postgresql newbie. > > It seems that primary key is not inherited by tables. > My situtation is as follows > > I've a parent table and child tables with inherit from > parent table. Parent table consists of pid (defualt > value of pid is from sequence) that is primary key. > Now all child tables inherits this attribute pid. > > I've another table from where i reference this pid as: > > pid integer references parent (pid) > > the table creation is successful, but when i try to > insert data into this table that refereces parent > table i get error - something like the referenced > column doesn't exist. Foreign key references currently go only to the table that explicitly named, not to any children tables so it won't see values of pid in the children. There's a few workaround solutions for cases like yours that have been sent to the mailing lists before, you may be able to find them on the archives.