Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id E76372E3F1E for ; Thu, 7 Feb 2008 03:16:26 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 54650-05 for ; Thu, 7 Feb 2008 03:16:23 -0400 (AST) Received: from bay0-omc2-s25.bay0.hotmail.com (bay0-omc2-s25.bay0.hotmail.com [65.54.246.161]) by postgresql.org (Postfix) with ESMTP id 6A3702E3F07 for ; Thu, 7 Feb 2008 03:16:23 -0400 (AST) Received: from BAY109-W22 ([64.4.19.122]) by bay0-omc2-s25.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 6 Feb 2008 23:16:21 -0800 Message-ID: Content-Type: multipart/alternative; boundary="_cebd9a94-bba2-4437-be0e-471fb79e6441_" X-Originating-IP: [82.57.144.190] From: Tiziano Slack To: Subject: Re: TG_TABLE_NAME as identifier Date: Thu, 7 Feb 2008 08:16:21 +0100 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 07 Feb 2008 07:16:21.0935 (UTC) FILETIME=[5765BBF0:01C86959] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=BAYES_50=0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200802/52 X-Sequence-Number: 30143 --_cebd9a94-bba2-4437-be0e-471fb79e6441_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Thanks for the precious tips, but unfortunately the syntax: EXECUTE 'INSERT INTO '|| TG_TABLE_NAME ||' SELECT '|| NEW.*;is parsed corre= ctly, 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=20 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/= --_cebd9a94-bba2-4437-be0e-471fb79e6441_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
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 followi= ng 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 q= uery that is not in a rule
CONTEXT:  SQL statement "INSERT INTO ana= g_referenti SELECT NEW.*"

Hope someone can show me another way to do= that, if exists ;)

Have a nice day!

T.


Racc= olta foto di Windows Live Ordina e condividi le tue foto in maniera semplice e v= eloce! = --_cebd9a94-bba2-4437-be0e-471fb79e6441_--