Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 09C2F475C4D for ; Fri, 12 Jul 2002 10:03:28 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id B00A4D602; Fri, 12 Jul 2002 07:03:28 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id A5BF65C02; Fri, 12 Jul 2002 07:03:28 -0700 (PDT) Date: Fri, 12 Jul 2002 07:03:28 -0700 (PDT) From: Stephan Szabo To: =?iso-8859-1?q?frederik=20nietzsche?= Cc: pgsql-sql Subject: Re: how to inherits the references... In-Reply-To: <20020712102958.36531.qmail@web12904.mail.yahoo.com> Message-ID: <20020712070009.U6410-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200207/185 X-Sequence-Number: 8564 On Fri, 12 Jul 2002, [iso-8859-1] frederik nietzsche wrote: > ok, thanks for the (double: two mails ;) ) help, but > in this way when I insert a record in a child table, > the key must be already present in the "sigles" table, > otherwise it breaks the reference and doesn't insert > anything. > In order to use this solution I must create a set of > function that when I want to insert something in a > child tables it automatically insert BEFORE, the sigle > in the "sigles" table and THEN insert the values in > the child table. A before trigger to insert into the key table would probably work. Another advantage to this sort of thing is that you could probably actually guarantee uniqueness of your key across the entire inheritance hierarchy which you can't otherwise. > If this is the only way, I'm going to use it, but I'm > not really satisfied by it... Inheritance is only marginally useful right now.