X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BF2CC5280B for ; Wed, 8 Jun 2005 13:27:35 -0300 (ADT) 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 77038-09 for ; Wed, 8 Jun 2005 16:27:27 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 94E405289A for ; Wed, 8 Jun 2005 13:27:26 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j58GRQVa003961; Wed, 8 Jun 2005 12:27:26 -0400 (EDT) To: Jay Parker Cc: pgsql-sql@postgresql.org Subject: Re: access to new/old in dynamic sql for audit table In-reply-to: <42A714A4.80602@ualr.edu> References: <42A714A4.80602@ualr.edu> Comments: In-reply-to Jay Parker message dated "Wed, 08 Jun 2005 10:54:12 -0500" Date: Wed, 08 Jun 2005 12:27:26 -0400 Message-ID: <3960.1118248046@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/114 X-Sequence-Number: 21715 Jay Parker writes: > I am revisiting the age-old audit table issue, and am curious to see > whether I can get away with not writing custom trigger functions for > every table being audited. You can't do it nohow in plpgsql. I believe it's relatively simple in pltcl or plperl, though, because those languages don't try to precompile column references. Or if you're feeling bold, you could write the trigger in C ;-). There are some examples that do pretty similar stuff in contrib/spi/. If performance is a big concern this would be a good plan anyway. regards, tom lane