Re: BUG #1956: Plpgsql top-level DECLARE does not share - Mailing list pgsql-bugs

From Karl O. Pinc
Subject Re: BUG #1956: Plpgsql top-level DECLARE does not share
Date
Msg-id 1129253651l.5855l.2l@mofo
Whole thread Raw
In response to Re: BUG #1956: Plpgsql top-level DECLARE does not share scope  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On 10/13/2005 03:24:23 PM, Tom Lane wrote:
> "Jim C. Nasby" <jnasby@pervasive.com> writes:
> > On Thu, Oct 13, 2005 at 01:30:56PM -0400, Tom Lane wrote:
> >> Basically, DECLARE introduces a new name scope that wouldn't be
> there
> >> if you didn't say DECLARE.  Without some bizarre reinterpretation
> of the
> >> meaning of a DECLARE at the start of a function, variables
> automatically
> >> created by plpgsql are going to be in an outer scope surrounding
> that of
> >> the first DECLARE.
>
> BTW, another issue here is that if we did merge the first DECLARE with
> the scope of auto-declared variables, it would be a non backwards
> compatible change.

How about merging only the auto-declared function arguments into the
first DECLARE?  Down side would be that I can see that causing
an actual error instead of a warning if somebody wants to shadow
one of the function arguments with their own declaration.


Karl <kop@meme.com>
Free Software:  "You don't pay back, you pay forward."
                  -- Robert A. Heinlein

P.S.
Seems that as of today I can no longer write Bruce Momjian
<pgman@candle.pha.pa.us>.  :-(  This showed up in a bounce:

--------<snip>---------
Hi. This is the qmail-send program at mail27.sea5.speakeasy.net.

<snip>

<pgman@candle.pha.pa.us>:
64.139.89.126 does not like recipient.
Remote host said: 550 5.0.0 <pgman@candle.pha.pa.us>... Delivery
blocked ---
Previous SPAM received from your mail server
Giving up on 64.139.89.126.

pgsql-bugs by date:

Previous
From: Dennis Vshivkov
Date:
Subject: Bug#333854: pg_group file update problems
Next
From: David Wheeler
Date:
Subject: Re: BUG #1959: readline error exiting psql