plpython: Remove support for major version conflict detection

Started by Peter Eisentraut8 months ago4 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

This essentially reverts commit 866566a690b, which installed safeguards
against loading plpython2 and plpython3 into the same process. We don't
support plpython2 anymore, so this is obsolete.

The Python and PL/Python initialization now happens again in _PG_init()
rather than the first time a PL/Python call handler is invoked. (Often,
these will be very close together.)

I kept the separate PLy_initialize() function introduced by 866566a690b
to keep _PG_init() a bit modular.

(I'm looking at the some further work to allow multiple interpreters in
PL/Python, so I'm trying to clean up the initialization code a bit first.)

Attachments:

0001-plpython-Remove-support-for-major-version-conflict-d.patchtext/plain; charset=UTF-8; name=0001-plpython-Remove-support-for-major-version-conflict-d.patchDownload+4-62
#2Mario Gonzalez
gonzalemario@gmail.com
In reply to: Peter Eisentraut (#1)
Re: plpython: Remove support for major version conflict detection

I'm attaching the same patch after rebasing from master. I had to just
change this in src/pl/plpython/plpy_main.c

- static bool PLy_procedure_is_trigger(Form_pg_proc procStruct);
+ static PLyTrigType PLy_procedure_is_trigger(Form_pg_proc procStruct);

Now the function returns PLyTrigType instead of a bool.

lgtm

On Wed, 8 Oct 2025 at 12:19, Peter Eisentraut <peter@eisentraut.org> wrote:

This essentially reverts commit 866566a690b, which installed safeguards
against loading plpython2 and plpython3 into the same process. We don't
support plpython2 anymore, so this is obsolete.

The Python and PL/Python initialization now happens again in _PG_init()
rather than the first time a PL/Python call handler is invoked. (Often,
these will be very close together.)

I kept the separate PLy_initialize() function introduced by 866566a690b
to keep _PG_init() a bit modular.

(I'm looking at the some further work to allow multiple interpreters in
PL/Python, so I'm trying to clean up the initialization code a bit first.)

--
https://www.linkedin.com/in/gonzalemario

Attachments:

0001-plpython-Remove-support-for-major-version-conflict-d.patchtext/x-patch; charset=US-ASCII; name=0001-plpython-Remove-support-for-major-version-conflict-d.patchDownload+4-62
#3Nathan Bossart
nathandbossart@gmail.com
In reply to: Mario Gonzalez (#2)
Re: plpython: Remove support for major version conflict detection

On Wed, Oct 08, 2025 at 12:28:45PM -0300, Mario González Troncoso wrote:

I'm attaching the same patch after rebasing from master.

LGTM

--
nathan

#4Peter Eisentraut
peter_e@gmx.net
In reply to: Nathan Bossart (#3)
Re: plpython: Remove support for major version conflict detection

On 08.10.25 18:41, Nathan Bossart wrote:

On Wed, Oct 08, 2025 at 12:28:45PM -0300, Mario González Troncoso wrote:

I'm attaching the same patch after rebasing from master.

LGTM

Committed, thanks.