Re: storing plpython global pointer - Mailing list pgsql-hackers

From Jan Urbański
Subject Re: storing plpython global pointer
Date
Msg-id 51A49FC5.3080106@wulczer.org
Whole thread Raw
In response to storing plpython global pointer  (Szymon Guz <mabewlun@gmail.com>)
Responses Re: storing plpython global pointer
List pgsql-hackers
On 28/05/13 14:04, Szymon Guz wrote:
> Hi,
> I need to store a global pointer for plpython usage. This is a PyObject*
> which can be initialized per session I think
>
> Where should I keep such a pointer?

Hi,

you probably could use a global variable, similar to PLy_interp_globals 
that's defined in plpy_main.c.

Another method would be to expose the Decimal constructor in the plpy 
module. You could modify plpy_plpymodule.c to import decimal and expose 
the Decimal constructor as plpy.Decimal.

Best,
Jan



pgsql-hackers by date:

Previous
From: Cédric Villemain
Date:
Subject: Re: PostgreSQL 9.3 beta breaks some extensions "make install"
Next
From: Cédric Villemain
Date:
Subject: Re: PostgreSQL 9.3 beta breaks some extensions "make install"