From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Marko Tiikkaja <marko(at)joh(dot)to>, Merlin Moncure <mmoncure(at)gmail(dot)com>, Joel Jacobson <joel(at)trustly(dot)com> |
Subject: | Re: merging some features from plpgsql2 project |
Date: | 2017-01-08 05:26:01 |
Message-ID: | CAFj8pRCE+mjSLsSmzX51fh=uYnUueBiSoaJYb7KBwjvJHX7YUw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
2017-01-08 4:11 GMT+01:00 Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>:
> On 1/7/17 8:53 PM, Tom Lane wrote:
>
>> If FOUND were declared at an outer scoping level such that any
>> user-created declaration overrode the name, then we could do likewise
>> for other auto variables and not fear compatibility breaks.
>>
>> Currently, though, we don't seem to be quite there: it looks like
>> FOUND is an outer variable with respect to DECLARE blocks, but it's
>> more closely nested than parameter names.
>>
>
> Sorry, I'm not following... you can override a parameter name the same way
> and get the same behavior, no?
>
It is declared before any custom identifier. If you override it, then you
are working with own variable - not with auto variable.
>
> BTW, I do wish you could change the label of the scope that arguments went
> into, so that you could use that label to refer to function parameters. If
> we allowed that it'd perhaps be the best of both worlds: you'd be
> guaranteed access to all auto variables and parameters, and that access
> wouldn't need to be tied to the function name (which can be both painful
> and error prone).
We can talk about compiler directive.
PRAGMA auto_variables_label(xxxx) -- require function scope only
BEGIN
IF xxxx.FOUND THEN
Regards
Pavel
>
> --
> Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
> Experts in Analytics, Data Architecture and PostgreSQL
> Data in Trouble? Get it in Treble! http://BlueTreble.com
> 855-TREBLE2 (855-873-2532)
>
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2017-01-08 05:30:14 | Re: Add support for SRF and returning composites to pl/tcl |
Previous Message | Pavel Stehule | 2017-01-08 05:19:50 | Re: merging some features from plpgsql2 project |