storing plpython global pointer - Mailing list pgsql-hackers

From Szymon Guz
Subject storing plpython global pointer
Date
Msg-id CAFjNrYuBE1BqvvHdYCvbfts+D99xvWOaM0i0FEnf2DRWTBgNuA@mail.gmail.com
Whole thread Raw
Responses Re: storing plpython global pointer
List pgsql-hackers
Hi,
I need to store a global pointer for plpython usage. This is a PyObject* which can be initialized per session I think, as we have to deal with Python 2 and Python 3. This pointer points to a Python constructor of Python's Decimal type, taken from python stdlib.

I've got working code, however loading python module each time there is Numeric argument in plpython function is not very efficient, so I'd like to do it once and keep this somewhere. This has no side effects as this is a pointer to a pure function.

Where should I keep such a pointer?

thanks,
Szymon

pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: [PATCH] add --throttle to pgbench (submission 3)
Next
From: Cédric Villemain
Date:
Subject: Re: PostgreSQL 9.3 beta breaks some extensions "make install"