Re: Use Python "Limited API" in PL/Python
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Jakob Egger <jakob@eggerapps.at>
Date: 2025-03-05T16:40:22Z
Lists: pgsql-hackers
Attachments
- v3-0001-Prepare-for-Python-Limited-API-in-PL-Python.patch (text/plain) patch v3-0001
- v3-0002-Activate-Python-Limited-API-in-PL-Python.patch (text/plain) patch v3-0002
On 03.03.25 11:17, Peter Eisentraut wrote: > Update for the hackers list: This patch set was briefly committed but > had to be reverted because it crashed on some older Python versions; see > [0]. > > I have locally reproduced the problem with Python 3.6 and 3.7; Python > 3.8 is ok. This matches the results from the buildfarm. > > I have poked at this a bit more but haven't gotten a good idea where or > how to fix it so far. Help welcome. I have figured this out. 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>. I have applied the workarounds described there to my patch set, and now it works for 3.6 and 3.7 as well.
Commits
-
Enable Python Limited API for PL/Python on MSVC
- 2bc60f86219b 19 (unreleased) landed
-
Activate Python "Limited API" in PL/Python
- 0793ab810038 18.0 landed
-
Prepare for Python "Limited API" in PL/Python
- 72a3d0462b9a 18.0 landed
- c47e8df815c1 18.0 landed
-
Remove obsolete Python version check
- 32c393f9f1f1 18.0 landed