Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id CCF38633730 for ; Mon, 22 Mar 2010 19:47:51 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 61534-07 for ; Mon, 22 Mar 2010 22:47:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id 4D110632F83 for ; Mon, 22 Mar 2010 19:47:40 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id o2MMlYI17160; Mon, 22 Mar 2010 18:47:34 -0400 (EDT) From: Bruce Momjian Message-Id: <201003222247.o2MMlYI17160@momjian.us> Subject: Re: insert in function writen in pgplsql In-Reply-To: To: Szymon Guz Date: Mon, 22 Mar 2010 18:47:34 -0400 (EDT) CC: Tom Lane , Julius Tuskenis , pgsql-admin@postgresql.org X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/159 X-Sequence-Number: 33958 Szymon Guz wrote: > 2010/3/19 Tom Lane > > > Szymon Guz writes: > > > You won't have to change the parameters in the function definition, > > instead > > > you can use the RENAME clause: > > > > > CREATE OR REPLACE FUNCTION add_user(user varchar(20), password > > varchar(20) ) > > > RETURNS VOID AS $$ > > > DECLARE > > > RENAME user TO x_user; > > > RENAME pa TO x_password; > > > BEGIN > > > > I wouldn't recommend relying on that, because RENAME has been removed in > > 9.0. I'm not convinced that it would have worked as desired in previous > > versions either. > > > > regards, tom lane > > > > Is alias also removed? > I've checked that and it works in 8.4 ALIAS is the recommended replacement for RENAME: http://developer.postgresql.org/pgdocs/postgres/release-9-0.html o Remove PL/pgSQL's RENAME declaration option (Tom) Instead, use ALIAS, which can now alias any variable, not just dollar sign variables, e.g. $1. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do