X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id 2BE05CCCFE for ; Fri, 18 Jul 2003 13:06:09 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 63083-08 for ; Fri, 18 Jul 2003 13:06:26 +0000 (GMT) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by svr1.postgresql.org (Postfix) with ESMTP id 2F8D6CB576 for ; Fri, 18 Jul 2003 10:05:57 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-35.mail.demon.net with esmtp (Exim 3.36 #2) id 19dUwE-0002oD-0Z; Fri, 18 Jul 2003 14:06:18 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 0C72B16789; Fri, 18 Jul 2003 14:06:07 +0100 (BST) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id 703EF15956; Fri, 18 Jul 2003 14:06:06 +0100 (BST) From: Richard Huxton To: Terence Kearns , Richard Huxton Subject: Re: (trigger function) -> ERROR: NEW used in non-rule query Date: Fri, 18 Jul 2003 14:06:00 +0100 User-Agent: KMail/1.5 Cc: Terence Kearns , pgsql-sql@postgresql.org References: <3F17AE38.5020302@cts.canberra.edu.au> <200307181003.42279.dev@archonet.com> <3F17BB5C.4020803@cts.canberra.edu.au> In-Reply-To: <3F17BB5C.4020803@cts.canberra.edu.au> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200307181406.00852.richardh@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/252 X-Sequence-Number: 14366 On Friday 18 July 2003 10:18, Terence Kearns wrote: > damn. There's realy no other way for me to access the value since the > trigger function will be called from different relations. > > I tried idval := (''NEW.'' || TG_ARGV[3]); but recieved > ERROR: pf_atoi: error in "NEW.blah": can't parse "NEW.blah" > > Oh well, can't win them all :/ Well, not this one at the moment, anyway. > Well I suppose I could try TCL. The problem is that there is little to > no documentation on postgres stored procedures in TCL and I've never > even seen the language before. None the less, I'll look into it. It's > almost worth it. If that fails, I may even try perl . if that > files, I will try to get --with-python to configure (which it's refusing > to do at the moment even though I have a working installation). Not sure if you can write triggers in perl, and I think python is going untrusted only (which means you need to be an admin to create functions). - Richard Huxton