Re: plpython is broken for recursive use - Mailing list pgsql-hackers

From Tom Lane
Subject Re: plpython is broken for recursive use
Date
Msg-id 17326.1445047412@sss.pgh.pa.us
Whole thread Raw
In response to Re: plpython is broken for recursive use  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: plpython is broken for recursive use  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
I wrote:
> This seems like a very Rube-Goldbergian way of setting up a local
> namespace for the user-defined code.  I think perhaps what we should do
> is:

> 1. Compile the user-supplied code directly into a code object, without
> wrapping it in a "def".  (Hence, PLy_procedure_munge_source goes away
> entirely, which would be nice.)  Forget about generating a code object
> containing a call, too.

After further study, it appears this approach won't work because it
breaks "yield" --- AFAICT, Python only allows "yield" inside a "def".

At this point I think what we need is to find a way of passing the
function parameters honestly, that is, as actual parameters in the
manufactured call.  I've not looked into how that might be done.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Foreign join pushdown vs EvalPlanQual
Next
From: Stephen Frost
Date:
Subject: Re: [PATCH v3] GSSAPI encryption support