Problem building both Python 2 and 3 into Postgres 9.4.4?

From: pbj(at)cmicdo(dot)com
To: pgsql-general(at)postgresql(dot)org
Subject: Problem building both Python 2 and 3 into Postgres 9.4.4?
Date: 2015-07-19 21:27:07
Message-ID: 1437341227.99029.YahooMailBasic@web161701.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Has anyone successfully built Python 2 and 3 into the same installation
of Postgres 9.4.4? I tried it today on Ubuntu 10.04, Python 2.6.5,
Python 3.1.2 and got and error about undefined symbol: PyString_AsString.
The Python docs say that PyString_* have been renamed to PyBytes_*
and I find references to both under ./src/pl/plpython. Is this a bug,
something I'm doing wrong, or perhaps my system is too old?

make distclean

./configure --with-openssl --with-libxml --with-libxslt --with-python PYTHON=/us
r/bin/python

make

./configure --with-openssl --with-libxml --with-libxslt --with-python PYTHON=/us
r/bin/python3

make

make install
service postgresql restart

psql -U postgres
postgres=# create database py2;
CREATE DATABASE
postgres=# create database py3;
CREATE DATABASE
postgres=# \c py2
You are now connected to database "py2" as user "postgres".
py2=# create extension plpython2u;
CREATE EXTENSION
py2=# \c py3
You are now connected to database "py3" as user "postgres".
py3=# create extension plpython3u;
ERROR: could not load library "/usr/local/pgsql/lib/plpython3.so": /usr/local/p
gsql/lib/plpython3.so: undefined symbol: PyString_AsString

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Spiros Ioannou 2015-07-19 21:49:09 Lots of stuck queries after upgrade to 9.4
Previous Message Joseph Kregloh 2015-07-19 20:27:56 Re: Upgrade postgres cluster on FreeBSD using pg_upgrade