Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id E9E416327A9 for ; Fri, 19 Mar 2010 16:16:27 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 15683-05 for ; Fri, 19 Mar 2010 19:16:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wy0-f174.google.com (mail-wy0-f174.google.com [74.125.82.174]) by mail.postgresql.org (Postfix) with ESMTP id EF08B633D36 for ; Fri, 19 Mar 2010 16:16:16 -0300 (ADT) Received: by wyb38 with SMTP id 38so1672736wyb.19 for ; Fri, 19 Mar 2010 12:16:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=+s9nQ3sLhy+acGRZc6LW9T3TmFwYHO7e2yx/EZn6Ldg=; b=PVLoie8D79RJv2h28r+Yquu8B5Y4rAOJINmt700racMDEObXMp5v5wXCvghiUVGjU/ jCVAcdJBVZ1amsr/8NP+LsKbaEJnLOl8sjWN8dlWxilGCEJdGSzxKVSZO93eOoh6pHYb u9TId4fsjti6L8rrfiHl+ZsK0iFF4Qs9zkk0g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Jrun5gWZu8FVKaOrvezmdBDx0QNcoEkfKURvgv36UPJLSos/Jx35fCw+td8rImoyAH 3kQbvCqY9IK84v4XBEYOct0cObXsB6t+1FZyMU+w/pjbpRotjWBYqAryMJ5tThifi1kY WP24xHysn96SFmnKvU808XlclHG86qtykS75w= MIME-Version: 1.0 Received: by 10.216.88.15 with SMTP id z15mr869238wee.113.1269026175590; Fri, 19 Mar 2010 12:16:15 -0700 (PDT) In-Reply-To: <3701.1269024300@sss.pgh.pa.us> References: <4BA37FF5.8060001@nsoft.lt> <3701.1269024300@sss.pgh.pa.us> Date: Fri, 19 Mar 2010 20:16:15 +0100 Message-ID: Subject: Re: insert in function writen in pgplsql From: Szymon Guz To: Tom Lane Cc: Julius Tuskenis , pgsql-admin@postgresql.org Content-Type: multipart/alternative; boundary=0016e6d9773568202004822c2e4f X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.273 tagged_above=-10 required=5 tests=AWL=0.325, BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201003/145 X-Sequence-Number: 33944 --0016e6d9773568202004822c2e4f Content-Type: text/plain; charset=UTF-8 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 regards, szymon guz --0016e6d9773568202004822c2e4f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

2010/3/19 Tom Lane <= ;tgl@sss.pgh.pa.us>
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex;">
Szymon Guz <mabe= wlun@gmail.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
> =C2=A0 RENAME user TO x_user;
> =C2=A0 RENAME pa TO x_password;
> BEGIN

I wouldn't recommend relying on that, because RENAME has been rem= oved in
9.0. =C2=A0I'm not convinced that it would have worked as desired in pr= evious
versions either.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0regards, tom lane

Is alias also removed?
I've check= ed that and it works in 8.4

regards,
szy= mon guz
--0016e6d9773568202004822c2e4f--