On 10/13/2005 03:24:23 PM, Tom Lane wrote:
"Jim C. Nasby" <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>
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.


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to