How to access OLD and NEW with rule on update - Mailing list pgsql-general

From Han Holl
Subject How to access OLD and NEW with rule on update
Date
Msg-id 20021126143220.28445.qmail@bever.palga.uucp
Whole thread Raw
Responses Re: How to access OLD and NEW with rule on update  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-general by date:

Previous
From: "Williams, Travis L, NPONS"
Date:
Subject: Re: process time of update
Next
From: Jeff Eckermann
Date:
Subject: Re: Migrating DAta from MSSQL to postgre