pgsql: Prepare for Python "Limited API" in PL/Python - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: Prepare for Python "Limited API" in PL/Python
Date
Msg-id E1tnJNu-000CZW-0X@gemulon.postgresql.org
Whole thread Raw
Responses Re: pgsql: Prepare for Python "Limited API" in PL/Python
List pgsql-committers
Prepare for Python "Limited API" in PL/Python

Using the Python Limited API would allow building PL/Python against
any Python 3.x version and using another Python 3.x version at run
time.  This commit does not activate that, but it prepares the code to
only use APIs supported by the Limited API.

Implementation details:

- Convert static types to heap types
  (https://docs.python.org/3/howto/isolating-extensions.html#heap-types).

- Replace PyRun_String() with component functions.

- Replace PyList_SET_ITEM() with PyList_SetItem().

Reviewed-by: Jakob Egger <jakob@eggerapps.at>
Discussion: https://www.postgresql.org/message-id/flat/ee410de1-1e0b-4770-b125-eeefd4726a24@eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c47e8df815c1c45f4e4fc90d5817d67ab088279f

Modified Files
--------------
src/pl/plpython/plpy_cursorobject.c  | 71 +++++++++++++++++---------
src/pl/plpython/plpy_planobject.c    | 61 ++++++++++++++--------
src/pl/plpython/plpy_procedure.c     |  5 +-
src/pl/plpython/plpy_resultobject.c  | 98 ++++++++++++++++++++++--------------
src/pl/plpython/plpy_subxactobject.c | 41 ++++++++-------
src/pl/plpython/plpy_typeio.c        |  6 +--
6 files changed, 177 insertions(+), 105 deletions(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pgsql: Remove redundant pg_set_*_stats() variants.
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Prepare for Python "Limited API" in PL/Python