Re: Doc patch--clarifying $1 in PL/PgSQL

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David Fetter <david(at)fetter(dot)org>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Doc patch--clarifying $1 in PL/PgSQL
Date: 2003-12-24 12:22:13
Message-ID: 3FE984F5.80800@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:
> Jan Wieck <JanWieck(at)Yahoo(dot)com> writes:
>> Tom Lane wrote:
>>> Not that hard ... just requires replacing some special-purpose code with
>>> general-purpose code ...
>
>> Does that code cause the variables value to change from function call to
>> function call (what most users would expect if they give it a default
>> value based on a call argument), or will remember the value from the
>> first function call for the lifetime of the backend?
>
> I believe it will evaluate the DEFAULT expression on each entry to the
> block, using the current values of outer-block variables (and also
> variables declared earlier in the same block, if anyone cared to use
> that behavior). The code was already designed and documented to
> evaluate DEFAULT expressions on each block entry --- what it was missing
> was the ability to reference variables in these expressions.
>
> Do you see something wrong with it?

No, I just didn't test it yet. My only concern was that it could be
another unexpected behaviour related to caching values/plans. Unexpected
caching is what most likely becomes FAQ's and I think we have enough of
those.

Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Christopher Kings-Lynne 2003-12-24 12:51:07 CATALOG/NOCATALOG for new users
Previous Message Tom Lane 2003-12-24 05:21:43 Re: Doc patch--clarifying $1 in PL/PgSQL