Received: from megazone.bigpanda.com ([63.150.15.178]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fAUHYgm97389 for ; Fri, 30 Nov 2001 12:34:43 -0500 (EST) (envelope-from sszabo@megazone23.bigpanda.com) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 3167DD5F1; Fri, 30 Nov 2001 09:34:47 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 271985BED; Fri, 30 Nov 2001 09:34:47 -0800 (PST) Date: Fri, 30 Nov 2001 09:34:47 -0800 (PST) From: Stephan Szabo To: =?iso-8859-1?q?Mart=EDn=20Marqu=E9s?= Cc: Subject: Re: variables in procedures In-Reply-To: <20011130134344.BED7EFA61@bugs.unl.edu.ar> Message-ID: <20011130093356.A55762-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by postgresql.org id fAUHjPL97830 X-Archive-Number: 200111/441 X-Sequence-Number: 5822 On Fri, 30 Nov 2001, [iso-8859-1] Martín Marqués wrote: > How can I distinguish between the name and the value of a variable? > > Example: > > CREATE FUNCTION test(VARCHAR) RETURNS INTEGER AS ' > > DECLARE > col1 ALIAS FOR $1 > BEGIN > select col1 from tab where col1=´´col1´´; > END; > ´ LANGUAGE 'plpgsql'; > > > Is my doubt understood? AFAIK you don't distinguish, you'll probably need to name the variable something else.