Enable Python Limited API for PL/Python on MSVC
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 14 Jan 2026 09:17:36 +0000 (10:17 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 14 Jan 2026 09:43:51 +0000 (10:43 +0100)
commit2bc60f86219b00a9ba23efab8f4bb8de21e64e2a
tree95ff777e3af674b03115a9e27ef2228ba74ced1e
parent4196d6178a125f2e80863a7ecd1d918207a9fe7b
Enable Python Limited API for PL/Python on MSVC

Previously, the Python Limited API was disabled on MSVC due to build
failures caused by Meson not knowing to link against python3.lib
instead of python3XX.lib when using the Limited API.

This commit works around the Meson limitation by explicitly finding
and linking against python3.lib on MSVC, and removes the preprocessor
guard that was disabling the Limited API on MSVC in plpython.h.

This requires python3.lib to be present in the Python installation,
which is included when Python is installed.

Author: Bryan Green <dbryan.green@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/ee410de1-1e0b-4770-b125-eeefd4726a24%40eisentraut.org
meson.build
src/pl/plpython/plpython.h