Received: from mail.malleenet.net.au (IDENT:root@[203.143.67.9]) by hub.org (8.10.1/8.10.1) with ESMTP id e8HDx8s35482; Sun, 17 Sep 2000 09:59:09 -0400 (EDT) Received: from hugin ([203.143.67.123]) by mail.malleenet.net.au (8.9.3/8.9.3) with SMTP id BAA29744; Mon, 18 Sep 2000 01:00:33 +1100 Message-ID: <004501c020b7$6cef4ce0$0100a8c0@hugin> Reply-To: "Horst Herb" From: "Horst Herb" To: Cc: Subject: trigger inheritance Date: Mon, 18 Sep 2000 00:55:55 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.org id e8HDxCt35493 X-Archive-Number: 200009/432 In Postgres, is it possible to write a (trigger) function for a table "parent" that is inherited automatically by tables "children" ? If so, how? And how would this trigger function access _all_ columns in the table "children"? Example: create table parent ( id serial, crc32 int4 ); create function calculate_crc() returns opaque as 'BEGIN new.crc32 = my_external_crc_func(); -- my_external_crc_func must be able to "see" all columns of "new" END;' language 'plpgsql'; CREATE TRIGGER inherited BEFORE INSERT OR UPDATE ON parent FOR EACH ROW EXECUTE PROCEDURE calculate_crc(); create table child ( something text ) inherits (parent); When I try this, "child" does not seem to inherit the trigger. What's more - I don't know how to let "my_external_crc_func" (loaded dynamically) can "see" all columns in "child". Who can help me? Most thankful for any hints, Horst