pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: silly sad <sad@bankir.ru>
To: pgsql-sql@postgresql.org
Subject: Re: [Trigger] Help needed with NEW.* and TG_TABLE_NAME
Date: Wed, 12 May 2010 10:00:53 +0400
Message-ID: <4BEA4415.2000902@bankir.ru> (raw)
In-Reply-To: <4BE96915.8040303@meisterderspiele.de>
References: <hsbiuo$rbe$1@news.eternal-september.org>
	<6038.1273587810@sss.pgh.pa.us>
	<4BE96915.8040303@meisterderspiele.de>

On 05/11/10 18:26, Torsten Zühlsdorff wrote:
>
>
> Tom Lane schrieb:
>> =?ISO-8859-15?Q?Torsten_Z=FChlsdorff?= <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.



view thread (9+ messages)  latest in thread

Message-ID: <4BEA4415.2000902@bankir.ru>
Permalink:  ../4BEA4415.2000902@bankir.ru/
Also on:    postgresql.org/message-id/4BEA4415.2000902@bankir.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sad@bankir.ru
  Subject: Re: [Trigger] Help needed with NEW.* and TG_TABLE_NAME
  In-Reply-To: <4BEA4415.2000902@bankir.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox