X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 20AD09DCD37 for ; Wed, 30 Nov 2005 05:18:43 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 01670-09-5 for ; Wed, 30 Nov 2005 05:18:41 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.203]) by postgresql.org (Postfix) with ESMTP id 08A9D9DCD4E for ; Wed, 30 Nov 2005 05:18:31 -0400 (AST) Received: by wproxy.gmail.com with SMTP id i34so1956106wra for ; Wed, 30 Nov 2005 01:18:33 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:user-agent:references:in-reply-to:organization:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=NO2xfJujIdqWnuP0bZHF9gALmXgR+51m02PDbXoFfjCxgunXYESg+ROdnFNh/afpA2ebN0RD3FtksnOb//LUMnQi7ZWHs5O/Ly7dreCQ7VJhugP8XtRYz+uf21fD/93dmQ21M436cFZ+LzgMrZWVN+vuODeo8Z+3BCp5o5ZTCAA= Received: by 10.64.213.11 with SMTP id l11mr834978qbg; Wed, 30 Nov 2005 01:18:33 -0800 (PST) Received: from aditatu.atlantic.ro ( [82.76.194.145]) by mx.gmail.com with ESMTP id e10sm982505qbe.2005.11.30.01.18.31; Wed, 30 Nov 2005 01:18:32 -0800 (PST) From: NosyMan To: pgsql-sql@postgresql.org Subject: Help needed Date: Wed, 30 Nov 2005 11:18:28 +0200 User-Agent: KMail/1.8.92 References: <200511291531.30441.leif@solumslekt.org> <200511291701.26148.leif@solumslekt.org> <200511291747.49570.leif@solumslekt.org> In-Reply-To: <200511291747.49570.leif@solumslekt.org> Organization: Noscom MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200511301118.28795.nosyman@gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/280 X-Sequence-Number: 23531 Hi everyone, I have some kind of strange problem. I want to build general parametrized trigger for my database. The parameter sent to the trigger contains a column name that trigger should be check. CREATE OR REPLACE FUNCTION F_T_IU__check() RETURNS trigger AS $$ DECLARE vt VARCHAR; BEGIN ........................................................... vt:='constant_value_id'; RAISE EXCEPTION 'aaa=%', NEW.vt; ............................................................. The 'vt' variable contains the column name. In the above statement I want that NEW.vt to be interpreted as NEW.constant_value_id. It is possible to do this? Thanks, Nosy