How to access OLD and NEW with rule on update

From: "Han Holl" <han(dot)holl(at)prismant(dot)nl>
To: pgsql-general(at)postgresql(dot)org
Subject: How to access OLD and NEW with rule on update
Date: 2002-11-26 14:32:20
Message-ID: 20021126143220.28445.qmail@bever.palga.uucp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hi,

I need to call a function when updating on a view, like :

create rule udps_upd as on update to udps do
instead select function_call();

My problem: how do I get a reference to OLD and NEW ?

I tried function_call(OLD, NEW) -- parse error
function_call(OLD.oid, NEW.oid) -- no such attributes
and function_call(OLD.ctid, NEW.ctid).

The last executes, but unfortunately I have no idea how to
proceed in the called function. In all fmgr macros, not one
seems to be concerned with a beast like a tid.

Or is there some information available in the passed
FunctionCallInfoData.context ?

Cheers,

Han Holl

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Eckermann 2002-11-26 14:40:34 Re: Migrating DAta from MSSQL to postgre
Previous Message Williams, Travis L, NPONS 2002-11-26 14:17:20 Re: process time of update