Re: NEW + tableOID

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ricardo Bayley <ricardo(dot)bayley(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: NEW + tableOID
Date: 2010-08-13 21:45:05
Message-ID: 22559.1281735905@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Ricardo Bayley <ricardo(dot)bayley(at)gmail(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ricardo Bayley 2010-08-13 22:05:39 Re: NEW + tableOID
Previous Message Ricardo Bayley 2010-08-13 21:33:01 Re: NEW + tableOID