Re: PL/pgSQL RENAME functionality in TODOs

From: imad <immaad(at)gmail(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PL/pgSQL RENAME functionality in TODOs
Date: 2007-01-31 07:15:40
Message-ID: 1f30b80c0701302315i5df8abe6s46d3aea5a3eb707c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

OK, so renaming does not work in the same block.
You can rename a vairable in a nested block and thats why it works for OLD/NEW.

BTW, what is the purpose behind it? Declaring a variable in a block
and quickly renaming it does not make sense to me.

--Imad
www.EnterpriseDB.com

On 1/31/07, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>
> URL added to TODO. (I didn't have URLs in there at the time).
>
> ---------------------------------------------------------------------------
>
> Tom Lane wrote:
> > imad <immaad(at)gmail(dot)com> writes:
> > > "Fix RENAME to work on variables other than OLD/NEW"
> > > I can rename just any variable declared in a PL block apart from
> > > OLD/NEW. Is the TODOs list out of sync or I am missing the point here?
> >
> > Really? It looks pretty broken to me still:
> >
> > regression=# create function foo() returns int as $$
> > regression$# declare
> > regression$# x int := 1;
> > regression$# rename x to y;
> > regression$# begin
> > regression$# return y;
> > regression$# end;$$ language plpgsql;
> > ERROR: syntax error at or near "x"
> > LINE 4: rename x to y;
> > ^
> >
> > See old discussion here:
> > http://archives.postgresql.org/pgsql-hackers/2002-03/msg00591.php
> >
> > regards, tom lane
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 1: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> > message can get through to the mailing list cleanly
>
> --
> Bruce Momjian bruce(at)momjian(dot)us
> EnterpriseDB http://www.enterprisedb.com
>
> + If your life is a hard drive, Christ can be your backup. +
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jens-Wolfhard Schicke 2007-01-31 08:28:42 Re: Improving NOT IN
Previous Message Tom Lane 2007-01-31 06:48:44 Re: stack usage in toast_insert_or_update()