X-Original-To: pgsql-novice-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 53A6F3CBB3B for ; Fri, 17 Dec 2004 04:05:39 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 43032-08 for ; Fri, 17 Dec 2004 04:05:29 +0000 (GMT) Received: from mail.99main.com (mail.99main.com [208.28.184.11]) by svr1.postgresql.org (Postfix) with ESMTP id 489DC3CBB10 for ; Fri, 17 Dec 2004 04:05:23 +0000 (GMT) Received: from 99main.com (localhost [127.0.0.1]) by mail.99main.com (8.12.8+Sun/8.12.8) with ESMTP id iBH45Kkw025745 for ; Thu, 16 Dec 2004 23:05:20 -0500 (EST) From: "Keith Worthington" To: "PostgreSQL Novice" Reply-To: KeithW@narrowpathinc.com Subject: FUNCTION, TRIGGER and best practices Date: Thu, 16 Dec 2004 23:05:20 -0500 Message-Id: <20041217040520.M87972@narrowpathinc.com> X-Mailer: Open WebMail 1.70 20020717 X-OriginatingIP: 68.235.22.242 (npkeithw) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200412/135 X-Sequence-Number: 11712 Hi All, I have a function/trigger pair operating that move data from one table to another after that data is inserted into the first table. Can triggers and functions have the same name? Is this a good practice? Where should the function and trigger be stored? In the same schema as the table they are connected to? I will now be attempting to expand this function to move data from two source tables to four or more target tables. (Different source columns go to different tables.) Is it possible to do a transaction/commit/rollback inside a function that is driven by a trigger so that if any portion of the transfer fails it is all rolled back? Thanks to all on this list that have helped me get this far. :-) Kind Regards, Keith ______________________________________________ 99main Internet Services http://www.99main.com