Received: from hotmail.com (f180.law14.hotmail.com [64.4.21.180]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7TABJf66652; Wed, 29 Aug 2001 06:11:19 -0400 (EDT) (envelope-from oomoomi@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 29 Aug 2001 03:11:17 -0700 Received: from 213.29.16.6 by lw14fd.law14.hotmail.msn.com with HTTP; Wed, 29 Aug 2001 10:11:16 GMT X-Originating-IP: [213.29.16.6] From: "omid omoomi" To: wagner@imsd.uni-mainz.de, pgsql-general@postgresql.org, pgsql-sql@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: [SQL] getting the oid for a new tuple in a BEFORE trigger Date: Wed, 29 Aug 2001 10:11:16 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 29 Aug 2001 10:11:17.0011 (UTC) FILETIME=[F0F57E30:01C13072] X-Archive-Number: 200108/969 X-Sequence-Number: 14386 hi, Idon't know the best way but how about a quick insert in a temp table and adding 1 to the inserted oid column each time the trigger will run.! regards Omid >From: Markus Wagner >To: pgsql-general@postgresql.org, pgsql-sql@postgresql.org, >pgsql-hackers@postgresql.org >Subject: [SQL] getting the oid for a new tuple in a BEFORE trigger >Date: Wed, 29 Aug 2001 11:15:08 +0200 > >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 > > >---------------------------(end of broadcast)--------------------------- >TIP 3: if posting/reading through Usenet, please send an appropriate >subscribe-nomail command to majordomo@postgresql.org so that your >message can get through to the mailing list cleanly _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp