FS#36875 - [postgresql] Python 3 (plpython3u) support
Attached to Project:
Arch Linux
Opened by paradoxxx (zero) - Wednesday, 11 September 2013, 12:30 GMT
Last edited by Levente Polyak (anthraxx) - Friday, 11 May 2018, 01:22 GMT
Opened by paradoxxx (zero) - Wednesday, 11 September 2013, 12:30 GMT
Last edited by Levente Polyak (anthraxx) - Friday, 11 May 2018, 01:22 GMT
|
Details
Description:
Python 3 is now by default in arch since a long time, maybe it's time to support it in the postgres build. A better option might be a generating 2 different optional packages (postgres-lib-python2, postgres-lib-python for instance). Debian already ships the plpython libs like this (http://packages.debian.org/stable/database/postgresql-plpython-9.1, http://packages.debian.org/stable/database/postgresql-plpython3-9.1) I managed to alter the postgres PKGBUILD in order to have two different build dirs (as it is required to run twice the configure with the different python versions) to generate both packages, see attached PKGBUILD. Warning: The attached PKGBUILD is just an example of how I managed to generate both plpython libs. Thanks Additional info: * Concerns postgresql-9.3.0, postgresql-libs-9.3.0 |
This task depends upon
Closed by Levente Polyak (anthraxx)
Friday, 11 May 2018, 01:22 GMT
Reason for closing: Implemented
Additional comments about closing: 10.4-1
Friday, 11 May 2018, 01:22 GMT
Reason for closing: Implemented
Additional comments about closing: 10.4-1
I think in modern version of Postgres -- will NOT problem with install both version of plpython<?>u (at same time. but in not use both it in one PG-session),
from Postgres documentation:
> It is not allowed to use PL/Python based on Python 2 and PL/Python based on Python 3 in the same session, because the symbols in the dynamic modules would clash, which could result in crashes of the PostgreSQL server process. There is a check that prevents mixing Python major versions in a session, which will abort the session if a mismatch is detected. It is possible, however, to use both PL/Python variants in the same database, from separate sessions.
thanks in advance! :-)
* make separate copy of source tree
* configure and build one tree with python2 and another with python3
* run installation from tree build with python3 and then the other build with python2
In final package files from python2 build overwrite identical files from python3 build. Extra files specific to python3 support are added. This should work fine because this is extension and there shoudl not be common file with different content.
I have tested it so far it runs trivial python code.
However, default python in postgres is 2 per definition of postgres, this will only change when postgres changes it. Very explicitly defined here: https://www.postgresql.org/docs/9.6/static/plpython-python23.html