Re: Shall we just get rid of plpgsql's RENAME?

From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Shall we just get rid of plpgsql's RENAME?
Date: 2009-11-05 14:51:06
Message-ID: 878wel81ph.fsf@hi-media-techno.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> DECLARE x int;
> BEGIN
> ... some stuff ...
> DECLARE y int;
> RENAME x to z;
> BEGIN
> ... other stuff ...
> END;
> ... yet more stuff ...
> END;
>
> What effect should the RENAME have on the name of "x" as seen by the
> code outside the inner DECLARE block?

None in my mind.

> As the documentation points out, there doesn't seem to be any real
> use for RENAME that isn't served as well or better by ALIAS, so
> I'm not especially interested in trying to puzzle out what it should
> do or how to make it do that. I want to just remove it. Or we could
> make it an alternative spelling for ALIAS. Comments?

The difference I'd not be surprised to see between RENAME and ALIAS
would be for RENAME to allow for inner blocks to reuse the renamed
variable (x in ... other stuff ... in your example), whereas using ALIAS
the variable just has 2 names.

Does it make any sense?
--
dim

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-11-05 14:51:48 Re: Shall we just get rid of plpgsql's RENAME?
Previous Message Alvaro Herrera 2009-11-05 14:50:30 Re: operator exclusion constraints