pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Torsten Zühlsdorff <foo@meisterderspiele.de>
To: pgsql-sql@postgresql.org
Subject: Re: [Trigger] Help needed with NEW.* and TG_TABLE_NAME
Date: Tue, 11 May 2010 16:26:29 +0200
Message-ID: <4BE96915.8040303@meisterderspiele.de> (raw)
In-Reply-To: <6038.1273587810@sss.pgh.pa.us>
References: <hsbiuo$rbe$1@news.eternal-september.org>
	<6038.1273587810@sss.pgh.pa.us>



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.

Greetings,
Torsten



view thread (9+ messages)  latest in thread

Message-ID: <4BE96915.8040303@meisterderspiele.de>
Permalink:  ../4BE96915.8040303@meisterderspiele.de/
Also on:    postgresql.org/message-id/4BE96915.8040303@meisterderspiele.de

 · 

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: foo@meisterderspiele.de
  Subject: Re: [Trigger] Help needed with NEW.* and TG_TABLE_NAME
  In-Reply-To: <4BE96915.8040303@meisterderspiele.de>

* 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