X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 009079FA68D for ; Mon, 26 Jun 2006 09:33:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 54634-03-3 for ; Mon, 26 Jun 2006 09:33:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id 430E19FB6A0 for ; Mon, 26 Jun 2006 07:43:19 -0300 (ADT) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=phlogiston.dydns.org) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1Fuof6-00015w-4a for pgsql-sql@postgresql.org; Mon, 26 Jun 2006 06:49:48 -0400 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 8C3FE4172; Mon, 26 Jun 2006 06:43:12 -0400 (EDT) Date: Mon, 26 Jun 2006 06:43:12 -0400 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: Fwd: Start up question about triggers Message-ID: <20060626104312.GB15992@phlogiston.dyndns.org> References: <006901c696c1$d2af82d0$6400a8c0@Dell4500> <200606231548.k5NFmhSW028183@auth-smtp.hol.gr> <20060623173504.GC12422@phlogiston.dyndns.org> <17077.1151084888@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/264 X-Sequence-Number: 25500 On Fri, Jun 23, 2006 at 10:29:33PM -0500, Aaron Bono wrote: > > What I really cannot find is a way to _dynamically_ in the trigger ask what > COLUMNS are in OLD and NEW. If we had: All of the columns, of course. When the tuple is UPDATEd, even if you did not mention some columns in your UPDATE, there is an OLD value and a NEW value. They're the same. > I wish I had more experience with stored procedures - I know what I would > try to do, just not if it is possible or how to implement it. I think what Tom (but I don't want to put words in his mouth) and, certainly, I have been saying is that your plan to get the list of transform commands is fundamentally misguided. If you want to track changes, then that's what you should do: track what changed. Note that there is a project that already, in fact, does this for you as part of how it works: Slony-I. A -- Andrew Sullivan | ajs@crankycanuck.ca When my information changes, I alter my conclusions. What do you do sir? --attr. John Maynard Keynes