getting the oid for a new tuple in a BEFORE trigger

From: Markus Wagner <wagner(at)imsd(dot)uni-mainz(dot)de>
To: pgsql-general(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: getting the oid for a new tuple in a BEFORE trigger
Date: 2001-08-29 09:15:08
Message-ID: 01082911150802.01558@jumbo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-sql

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message omid omoomi 2001-08-29 10:11:16 Re: [SQL] getting the oid for a new tuple in a BEFORE trigger
Previous Message omid omoomi 2001-08-29 09:06:35 Re: Question about plan

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Swan 2001-08-29 09:56:20 Re: bugs - lets call an exterminator!
Previous Message Alex Pilosov 2001-08-29 04:23:34 [PATCH] [LARGE] select * from cursor foo

Browse pgsql-sql by date

  From Date Subject
Next Message omid omoomi 2001-08-29 09:16:40 Re:
Previous Message Vladimir Terziev 2001-08-29 07:40:00