Re: pl/python do not delete function arguments

From: Jan Urbański <wulczer(at)wulczer(dot)org>
To: Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
Cc: Postgres - Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pl/python do not delete function arguments
Date: 2011-02-09 09:02:33
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 09/02/11 04:52, Hitoshi Harada wrote:
> 2010/12/31 Jan Urbański <wulczer(at)wulczer(dot)org>:
>> (continuing the flurry of patches)
>> Here's a patch that stops PL/Python from removing the function's
>> arguments from its globals dict after calling it. It's
>> an incremental patch on top of the plpython-refactor patch sent in
>> Git branch for this patch:
>> Apart from being useless, as the whole dict is unreffed and thus freed
>> in PLy_procedure_delete, removing args actively breaks things for
>> recursive invocation of the same function. The recursive callee after
>> returning will remove the args from globals, and subsequent access to
>> the arguments in the caller will cause a NameError (see new regression
>> test in patch).
> I've reviewed this. The patch is old enough to be rejected by patch
> command, but I manged to apply it by hand.
> It compiles clean. Added tests pass.
> I created fibonacci function similar to recursion_test in the patch
> and confirmed the recursion raises error on 9.0 but not on 9.1.
> Doc is not with the patch since this change is to remove unnecessary
> optimization internally.
> "Ready for Committer"


patch merged with HEAD attached.


Attachment Content-Type Size
plpython-dont-delete-arguments.patch text/x-patch 3.4 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Cousin Florence 2011-02-09 09:04:12 RE : [pgsql-fr-generale] create an extension of postgresql 9 with Visual C++ 2008 express edition
Previous Message Jeff Davis 2011-02-09 08:47:42 Re: postponing some large patches to 9.2