Re: [Trigger] Help needed with NEW.* and TG_TABLE_NAME

From: Torsten Zühlsdorff <foo(at)meisterderspiele(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: [Trigger] Help needed with NEW.* and TG_TABLE_NAME
Date: 2010-05-11 14:26:29
Message-ID: 4BE96915.8040303@meisterderspiele.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tom Lane schrieb:
> =?ISO-8859-15?Q?Torsten_Z=FChlsdorff?= <foo(at)meisterderspiele(dot)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.

Greetings,
Torsten

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stuart 2010-05-11 22:06:58 Re: [Trigger] Help needed with NEW.* and TG_TABLE_NAME
Previous Message Tom Lane 2010-05-11 14:23:30 Re: [Trigger] Help needed with NEW.* and TG_TABLE_NAME