Received: from yara.imsd.uni-mainz.de (yara.IMSD.Uni-Mainz.DE [134.93.144.68]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7T99Zf47185; Wed, 29 Aug 2001 05:09:35 -0400 (EDT) (envelope-from wagner@imsd.uni-mainz.de) Received: (from smap@localhost) by yara.imsd.uni-mainz.de (8.9.3/8.9.3/lxs_5.2) id LAA04872; Wed, 29 Aug 2001 11:09:12 +0200 Received: from hermes.imsd.uni-mainz.de(134.93.64.80) by yara.imsd.uni-mainz.de via smap (V2.1/2.1+anti-relay+anti-spam) id xma004838; Wed, 29 Aug 01 11:08:56 +0200 Received: from jumbo (unverified [134.93.64.115]) by hermes.imsd.uni-mainz.de (EMWAC SMTPRS 0.83) with SMTP id ; Wed, 29 Aug 2001 11:07:28 +0200 Content-Type: text/plain; charset="iso-8859-15" From: Markus Wagner Organization: IMSD To: pgsql-general@postgresql.org, pgsql-sql@postgresql.org, pgsql-hackers@postgresql.org Subject: getting the oid for a new tuple in a BEFORE trigger Date: Wed, 29 Aug 2001 11:15:08 +0200 X-Mailer: KMail [version 1.2] MIME-Version: 1.0 Message-Id: <01082911150802.01558@jumbo> Content-Transfer-Encoding: 8bit X-Archive-Number: 200108/1058 X-Sequence-Number: 14511 Hi, we need to control database changes within BEFORE triggers. There is no problem with triggers called by update, but there is a problem with triggers called by insert. We strongly need to know the oid of a newly inserted tuple. In this case, we use tg_newtuple of the TriggerData structure passed to thetrigger function, and its t_data -> t_oid will have the value '0'. Using BEFORE and AFTER triggers would make our lives much harder. Is there any way (even hack) to get the oid the newly inserted tuple will receive? Thank you very much, Markus