Re: [Trigger] Help needed with NEW.* and TG_TABLE_NAME - Mailing list pgsql-sql

From silly sad
Subject Re: [Trigger] Help needed with NEW.* and TG_TABLE_NAME
Date
Msg-id 4BEA4415.2000902@bankir.ru
Whole thread Raw
In response to Re: [Trigger] Help needed with NEW.* and TG_TABLE_NAME  (Torsten Zühlsdorff <foo@meisterderspiele.de>)
List pgsql-sql
On 05/11/10 18:26, Torsten Zühlsdorff wrote:
>
>
> Tom Lane schrieb:
>> Torsten Zühlsdorff <foo@meisterderspiele.de> writes:
>>> NEW.revision := addContentRevision (OLD.content_id, OLD.revision);
>>
>>> /* not working line, just a stub:
>>> EXECUTE 'INSERT INTO ' || TG_TABLE_NAME || ' SELECT $1 ' USING NEW;
>>> */
>>
>>> RETURN NULL;
>>
>> This seems like the hard way. Why don't you just RETURN NEW and let the
>> normal insertion happen?
>
> The trigger catches an UPDATE, not an INSERT. I need the old and the new
> row, because this should emulate revision-control of the content.

just set whatever value u want to the fields of the row NEW.


pgsql-sql by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: best paging strategies for large datasets?
Next
From: "Gnanakumar"
Date:
Subject: Invalid message format Exception