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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Torsten Zühlsdorff <foo(at)meisterderspiele(dot)de>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: [Trigger] Help needed with NEW.* and TG_TABLE_NAME
Date: 2010-05-11 14:23:30
Message-ID: 6038.1273587810@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

=?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?

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Torsten Zühlsdorff 2010-05-11 14:26:29 Re: [Trigger] Help needed with NEW.* and TG_TABLE_NAME
Previous Message Torsten Zühlsdorff 2010-05-11 12:36:51 [Trigger] Help needed with NEW.* and TG_TABLE_NAME