From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ricardo Bayley <ricardo.bayley@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: NEW + tableOID
Date: Fri, 13 Aug 2010 17:45:05 -0400
Message-ID: <22559.1281735905@sss.pgh.pa.us> (raw)
In-Reply-To: <AANLkTik5o6UBS0Vr_2n8kpu3NBr+P1zhiBf6QOke3A4k@mail.gmail.com>
References: <AANLkTik5o6UBS0Vr_2n8kpu3NBr+P1zhiBf6QOke3A4k@mail.gmail.com>
Ricardo Bayley <ricardo.bayley@gmail.com> writes:
> I do this with triggers. This issue I have is that the tableoid data cannot
> be used with the NEW keyword. I always get value 0 instead of the actual
> tableoid.
That might work in an AFTER trigger, but it definitely won't work in a
BEFORE trigger, because the NEW row isn't actually part of the table at
that point. You'd probably be better off to rely on the trigger
function TG_RELID parameter instead, anyway.
regards, tom lane
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-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, ricardo.bayley@gmail.com
Subject: Re: NEW + tableOID
In-Reply-To: <22559.1281735905@sss.pgh.pa.us>
* 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