Solved PostgreSQL, plpython3u

For some time now I'm trying to get Postgresql running with PL/Python and specifically plpython3u. Being new to all this, a lot of reading brought me to this:

After trying with the packages to no avail I turned to databases/postgresql10-server and later to databases/postgresql10-plpython.

Code:
root@db% cd /usr/ports/databases/posgresql10-server
root@db% make fetch
root@db% make extract
root@db% cd /usr/ports/databases/postgresql10-server/work/postgresql-10.5
root@db% ./configure PYTHON=/usr/local/bin/python3 --with-python --with-libraries=/usr/local/lib --with-includes=/usr/local/include/
root@db% cd /usr/ports/databases/posgresql10-server
root@db% make install

Regardless of what I put after PYTHON (/usr/local/bin/python3, /usr/local/bin/python3.6, /usr/local/bin/python3.6m) no PL/Python seems to be build.

Code:
CREATE EXTENSION plpython3u;

"/usr/local/share/postgresql/extension/plpython3u.control": No such file or directory

Doing similar with databases/postgresql10-plpython
Code:
root@db% cd /usr/ports/databases/posgresql10-plpython
root@db% make fetch
root@db% make extract
root@db% cd /usr/ports/databases/postgresql10-plpython/work/postgresql-10.5
root@db% ./configure PYTHON=/usr/local/bin/python3 --with-python --with-libraries=/usr/local/lib --with-includes=/usr/local/include/
root@db% cd /usr/ports/databases/posgresql10-plpython
root@db% make install

The above always results in plpythonu and plpython2u being available but not the sought after plpython3u. postgresq10-plpython seems to be hard wired to python2.7.

In need of some guidance,

TIA,

Ingo
 
postgresq10-plpython seems to be hard wired to python2.7.
Not exactly. As far as I can tell the port will use whatever is set as default. And the default Python is set to 2.7 (see /usr/ports/Mk/default-versions.mk).

You can change the defaults by setting in /etc/make.conf:
Code:
DEFAULT_VERSIONS+= python=3.6
But note that this will set the default to Python 3.6 for everything you build. Which may or may not work.
 
Back
Top