X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 01ED0475925 for ; Tue, 11 Feb 2003 11:31:04 -0500 (EST) Received: from smtp.blueyonder.co.uk (pc-62-31-245-195-gl.blueyonder.co.uk [62.31.245.195]) by postgresql.org (Postfix) with ESMTP id 51044475843 for ; Tue, 11 Feb 2003 11:31:03 -0500 (EST) Received: from reddragon.localdomain ([127.0.0.1] helo=localhost) by smtp.blueyonder.co.uk with esmtp (Exim 4.10) id 18idJZ-0002V9-00 for pgsql-sql@postgresql.org; Tue, 11 Feb 2003 16:31:21 +0000 Date: Tue, 11 Feb 2003 16:31:21 +0000 (GMT) From: Peter Childs X-X-Sender: peter@RedDragon.Childs To: pgsql-sql@postgresql.org Subject: Re: PL/Pgsql trigger function issue... In-Reply-To: <200302111106429.SM01180@digitalwizardry.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/219 X-Sequence-Number: 11617 On Tue, 11 Feb 103, arcpro wrote: > This is suppose to pull all the columns of the table that initiated the > trigger func from the sys catalogs, loop through them and put everything > that has changed between OLD and NEW into a comma delimited string for > input into a log like table for future analysis via middleware > (php,perl..,etc). Here is the problem, OLD.A results in 'old does not > have field A', which is true. I cant get the OLD and NEW record objects > to realize that I want OLD. for the column > name instead of an explicit A as the column name. The only way I can > find to make this work is by using TCL for the procedural language > because of the way it casts the OLD and NEW into an associative array > instead of a RECORD object, but by using TCL I will lose functionallity > in the "complete" version of the following function which has been > stripped to show my specific problem so using TCL is currently not in my > list of options. Any insight will be greatly appreciated. I have a trigger that does the same thing written in pl/python I've already posted it twice (to general and bugs about a 2 weeks ago) so I will not post it again :) The problem with it was (the reason it got on bugs) is that when I had it switched on on almost all my tables after a series of queries the back-end of 7.3.1 crashes. I think its something to do with which particular query run in what order but the queries work fine without the trigger in the database and don't without it. I've still had no response so I have left it off for the moment but I would like to switch it on. I might try 7.3.2 but I don't know whether its worth it! The other place to look is at the replication scripts such as dbmirror in contrib which I must get going (or something like that) at some point (Need 24x7 uptime!!) There seam to be several replication projects which one is the best/most developed/easy to implement. I would like a dual master rather than a master slave configuration if that possible. Peter Childs