postgresql/src/pl/plpython
Peter Eisentraut 72a3d0462b 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().

This was previously committed as c47e8df815 and then reverted because
it wasn't working under Python older than 3.8.  That has been fixed in
this version.  There was a Python API change/bugfix between 3.7 and
3.8 that directly affects this patch.  The relevant commit is
<https://github.com/python/cpython/commit/364f0b0f19c>.  The
workarounds described there have been applied in this patch, and it
has been confirmed to work with Python 3.6 and 3.7.

Reviewed-by: Jakob Egger <jakob@eggerapps.at>
Discussion: https://www.postgresql.org/message-id/flat/ee410de1-1e0b-4770-b125-eeefd4726a24@eisentraut.org
2025-03-12 08:53:54 +01:00
..
expected Virtual generated columns 2025-02-07 09:46:59 +01:00
po Update copyright for 2025 2025-01-01 11:21:55 -05:00
sql Virtual generated columns 2025-02-07 09:46:59 +01:00
.gitignore plpython: Remove regression test infrastructure for Python 2. 2022-03-07 18:20:51 -08:00
generate-spiexceptions.pl Update copyright for 2025 2025-01-01 11:21:55 -05:00
Makefile Hide warnings from Python headers when using gcc-compatible compiler. 2023-12-26 16:16:37 -05:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
nls.mk Make formatting in nls.mk files more consistent 2024-05-14 09:21:17 +02:00
plpy_cursorobject.c Prepare for Python "Limited API" in PL/Python 2025-03-12 08:53:54 +01:00
plpy_cursorobject.h Make PL/Python handle domain-type conversions correctly. 2017-11-16 16:23:04 -05:00
plpy_elog.c Fix assertion failure with PL/Python exceptions 2023-09-19 08:31:06 +09:00
plpy_elog.h Mark all symbols exported from extension libraries PGDLLEXPORT. 2022-07-17 18:50:14 -07:00
plpy_exec.c Remove obsolete Python version check 2025-02-25 14:11:38 +01:00
plpy_exec.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
plpy_main.c Don't bother checking the result of SPI_connect[_ext] anymore. 2024-09-09 12:18:34 -04:00
plpy_main.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
plpy_planobject.c Prepare for Python "Limited API" in PL/Python 2025-03-12 08:53:54 +01:00
plpy_planobject.h Repair memory leaks in plpython. 2025-01-11 11:45:56 -05:00
plpy_plpymodule.c Remove unused #include's from contrib, pl, test .c files 2024-10-28 08:02:17 +01:00
plpy_plpymodule.h plpython: add missing plpython.h include to plpy_plpymodule.h 2022-03-08 09:47:34 -08:00
plpy_procedure.c Prepare for Python "Limited API" in PL/Python 2025-03-12 08:53:54 +01:00
plpy_procedure.h Don't corrupt plpython's "TD" dictionary in a recursive trigger call. 2024-05-07 18:15:00 -04:00
plpy_resultobject.c Prepare for Python "Limited API" in PL/Python 2025-03-12 08:53:54 +01:00
plpy_resultobject.h Fix assorted header files that failed to compile standalone. 2019-05-31 11:45:33 -04:00
plpy_spi.c Repair memory leaks in plpython. 2025-01-11 11:45:56 -05:00
plpy_spi.h Fix SPI's handling of errors during transaction commit. 2022-02-28 12:45:36 -05:00
plpy_subxactobject.c Prepare for Python "Limited API" in PL/Python 2025-03-12 08:53:54 +01:00
plpy_subxactobject.h Make the order of the header file includes consistent. 2019-11-25 08:08:57 +05:30
plpy_typeio.c Prepare for Python "Limited API" in PL/Python 2025-03-12 08:53:54 +01:00
plpy_typeio.h Mark all symbols exported from extension libraries PGDLLEXPORT. 2022-07-17 18:50:14 -07:00
plpy_util.c Remove unused #include's from contrib, pl, test .c files 2024-10-28 08:02:17 +01:00
plpy_util.h Mark all symbols exported from extension libraries PGDLLEXPORT. 2022-07-17 18:50:14 -07:00
plpython.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
plpython3u--1.0.sql Invent "trusted" extensions, and remove the pg_pltemplate catalog. 2020-01-29 18:42:43 -05:00
plpython3u.control Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpython_system.h Update copyright for 2025 2025-01-01 11:21:55 -05:00