Re: [PATCH] pl: fix can not build free-thread for plpython extension like 3.14t - Mailing list pgsql-hackers

From 洪伊
Subject Re: [PATCH] pl: fix can not build free-thread for plpython extension like 3.14t
Date
Msg-id CAFDmy2yfx9VO7ToV-+axhwVry5vuCj9Q1E2DZ0=HTsOXTdVGZw@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] pl: fix can not build free-thread for plpython extension like 3.14t  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCH] pl: fix can not build free-thread for plpython extension like 3.14t
List pgsql-hackers
Hi

I understand the reason for using Py_LIMITED_API, and python 3.14t is a standard build from cpython team.

link: https://docs.python.org/3/whatsnew/3.14.html#whatsnew314-free-threaded-now-supported

It seems the only way to build plpython for free-thread python is to use Py_LIMITED_API, otherwise it fails to build.


Thanks
Hong Yi

On Fri, Jan 16, 2026 at 12:01 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
洪伊 <zouzou0208@gmail.com> writes:
> This patch fix can not build plpython for free-thread python like
> python3.14t

We've gone to fairly considerable trouble to switch to using Python's
limited API, for reasons described here:

https://www.postgresql.org/message-id/ee410de1-1e0b-4770-b125-eeefd4726a24@eisentraut.org

I don't see why we should abandon that for the convenience of
somebody's evidently-nonstandard Python build.

The proposed patch also breaks the header isolation that
the separate plpython_system.h header is meant to maintain.
Arguably we should have #define'd Py_LIMITED_API inside
plpython_system.h, not where it is.  But I don't feel a need
to mess with that without a far better argument for why
we should change this at all.

                        regards, tom lane

pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: using index to speedup add not null constraints to a table
Next
From: Amit Kapila
Date:
Subject: Re: Simplify code building the LR conflict messages