Skip to content

Commit 0793ab8

Browse files
committed
Activate Python "Limited API" in PL/Python
This allows building PL/Python against any Python 3.x version and using another Python 3.x version at run time. This is useful for installers that want to run against a separately downloaded Python, so that they don't have to bundle it themselves. This builds on the earlier patch to only use APIs supported by the Limited API. At the moment, this is not activated on MSVC because that leads to build failures that no one could explain or cared enough to address. This could be done later. Reviewed-by: Jakob Egger <[email protected]> Discussion: https://www.postgresql.org/message-id/flat/[email protected]
1 parent 05cbd6c commit 0793ab8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/pl/plpython/plpython.h

+9
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@
1919
#error Python.h must be included via plpython.h
2020
#endif
2121

22+
/*
23+
* Enable Python Limited API
24+
*
25+
* XXX currently not enabled on MSVC because of build failures
26+
*/
27+
#if !defined(_MSC_VER)
28+
#define Py_LIMITED_API 0x03020000
29+
#endif
30+
2231
/*
2332
* Pull in Python headers via a wrapper header, to control the scope of
2433
* the system_header pragma therein.

0 commit comments

Comments
 (0)