Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 0DCA29F9A5B for ; Sat, 11 Aug 2007 16:07:43 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 10099-06 for ; Sat, 11 Aug 2007 16:07:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from depesz.com (depesz.com [88.198.37.40]) by postgresql.org (Postfix) with ESMTP id 4AE809F9A42 for ; Sat, 11 Aug 2007 16:07:40 -0300 (ADT) Received: from chello084010144047.chello.pl ([84.10.144.47] helo=xxx.home.depesz.com) by depesz.com with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1IJwJB-0004Pd-SR; Sat, 11 Aug 2007 21:07:37 +0200 Received: from depesz by xxx.home.depesz.com with local (Exim 4.63) (envelope-from ) id 1IJwJA-0005TU-Te; Sat, 11 Aug 2007 21:07:32 +0200 Date: Sat, 11 Aug 2007 21:07:32 +0200 From: hubert depesz lubaczewski To: "Javier Fonseca V." Cc: pgsql-sql@postgresql.org Subject: Re: Trigger Procedure Error: NEW used in query that is not in a rule Message-ID: <20070811190732.GB7915@depesz.com> Reply-To: depesz@depesz.com References: <86d227fd0708110043q341a2908q67e87570bca89492@mail.gmail.com> <86d227fd0708110045t16e39442xd35746eb59296362@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <86d227fd0708110045t16e39442xd35746eb59296362@mail.gmail.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/100 X-Sequence-Number: 29038 On Sat, Aug 11, 2007 at 02:45:09AM -0500, Javier Fonseca V. wrote: > I think that it's working alright except for the next line: doing this in plpgsql is very complicated (or even impossible assuming that any table can have the same trigger). i would rather suggest using pl/perl - writing something like this in pl/perl is very simple. depesz -- quicksil1er: "postgres is excellent, but like any DB it requires a highly paid DBA. here's my CV!" :) http://www.depesz.com/ - blog dla ciebie (i moje CV)