Re: getting the oid for a new tuple in a BEFORE trigger

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: Markus Wagner <wagner(at)imsd(dot)uni-mainz(dot)de>, pgsql-sql(at)postgresql(dot)org
Subject: Re: getting the oid for a new tuple in a BEFORE trigger
Date: 2001-08-29 14:38:00
Message-ID: web-110336@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-sql

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(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco

Attachment Content-Type Size
unknown_filename text/plain 2 bytes
unknown_filename text/plain 2 bytes
unknown_filename text/plain 2 bytes

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Erol Öz 2001-08-29 14:59:53 pg_dump error
Previous Message Mitch Vincent 2001-08-29 14:23:53 Re: RFC: PostgreSQL and MySQL comparison.

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2001-08-29 15:34:48 Re: Upcoming events
Previous Message Peter Eisentraut 2001-08-29 13:55:05 Re: compile error: c_lock assembler

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2001-08-29 18:24:56 Re: changes to table creation syntax in 7.1.2?
Previous Message omid omoomi 2001-08-29 10:11:16 Re: [SQL] getting the oid for a new tuple in a BEFORE trigger