[prev in list] [next in list] [prev in thread] [next in thread]
List: postgresql-general
Subject: Re: [GENERAL] PlPython
From: elein <elein () varlena ! com>
Date: 2003-06-30 21:59:30
[Download RAW message or body]
7.3 doc says:
> The global dictionary SD is available to store data between function calls. This \
> variable is private static data. The global dictionary GD is public data, \
> available to all Python functions within a session. Use with care.>
> Each function gets its own restricted execution object in the Python interpreter, \
> so that global data and > function arguments from myfunc are not available to \
> myfunc2. The exception is the data in the GD dictionary, as mentioned above.
I think the above is correct, and the terms I used could be confusing. The doc
is calling both GD and SD global data. These are distinct from the function \
arguments. Function arguments are distinct to the invocation of the function.
You can get to GD elements from any called plpython function. You can get to SD \
elements only from (re-)calling the same plpython function.
How about changing the second paragraph to:
Each function gets its own restricted execution object in the Python interpreter \
so that SD global data and function arguments from myfunc are not available to \
myfunc2. Data stored in the GD dictionary by myfunc may be accessed by myfunc2.
More than you wanted to know, I'm sure.
elein
On Monday 30 June 2003 14:49, Tom Lane wrote:
> elein <elein@varlena.com> writes:
> > The global data (GD) and function data (SD)
> > work as they always have worked.
>
> Right, but the para at issue was claiming you couldn't access any global
> data *except* GD.
>
> regards, tom lane
>
>
--
=============================================================
elein@varlena.com Database Consulting www.varlena.com
PostgreSQL General Bits http:/www.varlena.com/GeneralBits/
"Free your mind the rest will follow" -- en vogue
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic