From: Tiziano Slack <slack83@hotmail.it>
To: pgsql-sql@postgresql.org
Subject: Re: TG_TABLE_NAME as identifier
Date: Thu, 7 Feb 2008 08:16:21 +0100
Message-ID: <BAY109-W22937ED37F3081CAEC9F26CE2E0@phx.gbl> (raw)
Thanks for the precious tips, but unfortunately the syntax:
EXECUTE 'INSERT INTO '|| TG_TABLE_NAME ||' SELECT '|| NEW.*;is parsed correctly, but when the trigger is fired the following error is returned
ERROR: column "*" not found in data type mytable
CONTEXT: SQL statement "SELECT 'INSERT INTO '|| $1 ||' SELECT '|| $2 .*"
Using
EXECUTE 'INSERT INTO '|| TG_TABLE_NAME ||' SELECT NEW.*';
instead, returns:
ERROR: NEW used in query that is not in a rule
CONTEXT: SQL statement "INSERT INTO anag_referenti SELECT NEW.*"
Hope someone can show me another way to do that, if exists ;)
Have a nice day!
T.
_________________________________________________________________
Ti piace giocare con le lettere? Prova ABCLive!
http://messengergiochi.it.msn.com/=
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: slack83@hotmail.it
Subject: Re: TG_TABLE_NAME as identifier
In-Reply-To: <BAY109-W22937ED37F3081CAEC9F26CE2E0@phx.gbl>
* 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