pgsql: Enable Python Limited API for PL/Python on MSVC

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Enable Python Limited API for PL/Python on MSVC
Date: 2026-01-14 09:53:18
Message-ID: E1vfxZ0-000P6X-0h@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)green(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/flat/ee410de1-1e0b-4770-b125-eeefd4726a24%40eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2bc60f86219b00a9ba23efab8f4bb8de21e64e2a

Modified Files
--------------
meson.build | 16 +++++++++++++++-
src/pl/plpython/plpython.h | 4 ----
2 files changed, 15 insertions(+), 5 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2026-01-14 14:35:32 pgsql: doc: Slightly correct advice on C/C++ linkage
Previous Message Álvaro Herrera 2026-01-14 09:14:22 pgsql: Reword confusing comment to avoid "typo fixes"