Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7TEc6f42142 for ; Wed, 29 Aug 2001 10:38:06 -0400 (EDT) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.1) with HTTP id 110336; Wed, 29 Aug 2001 07:38:00 -0700 From: "Josh Berkus" Subject: Re: getting the oid for a new tuple in a BEFORE trigger To: Markus Wagner , pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.4.1 Date: Wed, 29 Aug 2001 07:38:00 -0700 Message-ID: In-Reply-To: <01082911150802.01558@jumbo> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="_===110336====davinci.ethosmedia.com===_" X-Archive-Number: 200108/351 X-Sequence-Number: 4601 This is a multi-part MIME message --_===110336====davinci.ethosmedia.com===_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8bit Mark, The responses to your problem are gonna be kinda slow, as 2/3 of the core team, and many of the users, are at the Expo right now (and if anyone on the list is in the SF Bay Area, join us! BOF session tonight!) > 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. What problem? > 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. Once again, why? > Is there any way (even hack) to get the oid the newly inserted tuple > will > receive? This specific answer will have to come from someone else. I could suggest a couple of workarounds, if you gave a fuller description of exactly what you're trying to accomplish. -Josh Berkus P.S. Please do not cross-post to more than 2 lists at a time. The Postgres lists have been kept to a managable volume to date; let's keep it that way. ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco --_===110336====davinci.ethosmedia.com===_ Content-Type: text/plain Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 DQo= --_===110336====davinci.ethosmedia.com===_ Content-Type: text/plain Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 DQo= --_===110336====davinci.ethosmedia.com===_ Content-Type: text/plain Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 DQo= --_===110336====davinci.ethosmedia.com===_--