pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Francesco Casadei <f_casadei@libero.it>
To: Markus Wagner <wagner@imsd.uni-mainz.de>
Cc: pgsql-general@postgresql.org
Cc: pgsql-sql@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: [SQL] getting the oid for a new tuple in a BEFORE trigger
Date: Thu, 30 Aug 2001 11:05:23 +0200
Message-ID: <20010830110523.A1627@goku.kasby> (raw)
In-Reply-To: <01082911150802.01558@jumbo>
References: <01082911150802.01558@jumbo>

On Wed, Aug 29, 2001 at 11:15:08AM +0200, Markus Wagner wrote:
> 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
> 
> end of the original message

Read section 24.2.5.4 'Obtaining other results status' of the Programmer's
Guide. This is for the PL/pgSQL language, though.

	Francesco Casadei



view thread (8+ messages)  latest in thread

Message-ID: <20010830110523.A1627@goku.kasby>
Permalink:  ../20010830110523.A1627@goku.kasby/
Also on:    postgresql.org/message-id/20010830110523.A1627@goku.kasby

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: f_casadei@libero.it, wagner@imsd.uni-mainz.de, pgsql-general@postgresql.org, pgsql-hackers@postgresql.org
  Subject: Re: [SQL] getting the oid for a new tuple in a BEFORE trigger
  In-Reply-To: <20010830110523.A1627@goku.kasby>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox