From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | Szymon Guz <mabewlun(at)gmail(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Julius Tuskenis <julius(at)nsoft(dot)lt>, pgsql-admin(at)postgresql(dot)org |
Subject: | Re: insert in function writen in pgplsql |
Date: | 2010-03-22 22:47:34 |
Message-ID: | 201003222247.o2MMlYI17160@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
Szymon Guz wrote:
> 2010/3/19 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>
> > Szymon Guz <mabewlun(at)gmail(dot)com> 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 <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2010-03-22 23:07:35 | Re: Disparity between 8.1.18 and 8.2.14 performance wise |
Previous Message | Scott Marlowe | 2010-03-22 22:32:22 | Re: Disparity between 8.1.18 and 8.2.14 performance wise |