Re: BUG #1956: Plpgsql top-level DECLARE does not share

From: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1956: Plpgsql top-level DECLARE does not share
Date: 2005-10-14 01:34:11
Message-ID: 1129253651l.5855l.2l@mofo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


On 10/13/2005 03:24:23 PM, Tom Lane wrote:
> "Jim C. Nasby" <jnasby(at)pervasive(dot)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(at)meme(dot)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(at)candle(dot)pha(dot)pa(dot)us>. :-( This showed up in a bounce:

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

<snip>

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tony Caduto 2005-10-14 01:48:26 BUG #1966: Single OUT PARM does not return param name.
Previous Message Bruce Momjian 2005-10-13 20:33:49 Re: BUG #1931: ILIKE and LIKE fails on Turkish locale