Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 40EBE475DA7 for ; Thu, 9 Jan 2003 14:13:00 -0500 (EST) Received: from mill.mtholyoke.edu (mill.mtholyoke.edu [138.110.30.76]) by postgresql.org (Postfix) with ESMTP id A82D3475C2B for ; Thu, 9 Jan 2003 14:12:59 -0500 (EST) Received: from mill.mtholyoke.edu (mill [127.0.0.1]) by mill.mtholyoke.edu (8.12.3/8.12.3/Debian -4) with ESMTP id h09JCw0P006771 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=FAIL) for ; Thu, 9 Jan 2003 14:12:58 -0500 Received: (from yrp001@localhost) by mill.mtholyoke.edu (8.12.3/8.12.3/Debian -4) id h09JCw9Q006769 for pgsql-sql@postgresql.org; Thu, 9 Jan 2003 14:12:58 -0500 From: Ron Peterson Date: Thu, 9 Jan 2003 14:12:58 -0500 To: pgsql-sql@postgresql.org Subject: Re: insert rule doesn't see id field Message-ID: <20030109191258.GA6739@mtholyoke.edu> Mail-Followup-To: pgsql-sql@postgresql.org References: <20030107145422.GE12245@mtholyoke.edu> <13558.1041955268@sss.pgh.pa.us> <20030108181303.GA23456@mtholyoke.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030108181303.GA23456@mtholyoke.edu> User-Agent: Mutt/1.3.28i Organization: Mount Holyoke College X-Operating-System: Debian GNU/Linux X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/136 X-Sequence-Number: 11001 On Wed, Jan 08, 2003 at 01:13:03PM -0500, Ron Peterson wrote: > On Tue, Jan 07, 2003 at 11:01:08AM -0500, Tom Lane wrote: > > > > I thought that the idea behind noup was to protect single columns from > > > update. However, when I apply the noup trigger as above, I can't > > > update /any/ column. Is this the intended behaviour? > > > > Idly looking at the source code for contrib/noupdate/noup.c, I don't > > believe that it has ever worked as advertised: it seems to reject any > > non-null value for the target column, independently of whether the > > value is the same as before (which is what I'd have thought it should > > do). > > > > Is anyone interested in fixing it? Or should we just remove it? > > If it's been there since 6.4 and you're the first person to try to use > > it, as seems to be the case, then I'd have to say that it's a waste of > > space in the distribution. > > I'm going to see if I can create this function. Well, I think I've thunk something up. Of course I'm happy to submit my modification for distribution or ridicule, as the case may be. Where should I submit this? I made a function noupcols() which takes one or more column names as arguments. The function then creates a new tuple by getting the old values for those columns, and then doing an SPI_modifytuple on the new tuple using the old values for those columns. I'm kind of flying by the seat of my pants here, so if anyone would care to critically review my code, by all means... -- Ron Peterson -o) Network & Systems Manager /\\ Mount Holyoke College _\_v http://www.mtholyoke.edu/~rpeterso ----