How to access OLD and NEW with rule on update

Поиск
Список
Период
Сортировка
От Han Holl
Тема How to access OLD and NEW with rule on update
Дата
Msg-id 20021126143220.28445.qmail@bever.palga.uucp
обсуждение исходный текст
Ответы Re: How to access OLD and NEW with rule on update  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: "Williams, Travis L, NPONS"
Дата:
Сообщение: Re: process time of update
Следующее
От: Jeff Eckermann
Дата:
Сообщение: Re: Migrating DAta from MSSQL to postgre