

Therefore, at the end of this story, I was unable to get Python 3 working within the plpython language until I compile PostgreSQL by myself. I then compiled it passing the -with-python at configure time and after a while I had a PostgreSQL 10.3 instance running and with Python 3.6 working. Once you start the boost-python install, consider going for a nice walk as the build can take a bit of time (10-15.
Freebsd python 3 install install#
I then switched back to FreeBSD and got the latest PostgreSQL 10.3 source code. brew install cmake brew install boost brew install boost-python -with-python3 The -with-python3 flag ensures that Python 3 bindings for Boost.Python are compiled as well Python 2.7 bindings are compiled by default. However I was unable to solve it, probably due to my poor Python knowledge. So, it seemed a Python-configuration problem. LOG: server process (PID 18776 ) was terminated by signal 6: Aborted

I then inspected such file in order to see what it was missing:Ĭould not find platform independent libraries Ĭould not find platform dependent libraries įatal Python error: Py_Initialize: Unable to get the locale encoding Again, this was not working, since the server was unable to load the libpython3.so even if that was in place! I then switched back to another Ubuntu machine, older than the previous one, and tried installing the whole Enterprise DB Interactive Installer, hoping it would come with a self-contained version. The problem seemed to me that the system was using Python 3.7 and the plpython package was requiring Python 3.5, which is no more supported on that version of Ubuntu. In order to better understand what was missing, I switched to a clean /Ubuntu 17.10/ installing all the deb packages for PostgreSQL and Python, but again this was not working. I then tried installing the port of the very same name, but again it was installing only the libpython2.so. Unluckily it did not!Ĭreating a plpython3u language did not succeed, and the problem was that the above package installed only the libpython2.so under the lib directory (e.g., /usr/local/lib/postgresql). My default environment for running PostgreSQL is FreeBSD, so in order to get plpython working I jumped to the console and installed the package postgresql10-plpython-10.3, thinking of course that FreeBSD would do the right thing.

4 ( default, , 01 : 25 : 35 ) + postgres =# SELECT proname, prolang, prosrc FROM pg_proc WHERE proname = 'pyv' - proname | pyv prolang | 16387 prosrc | + | import sys + | return sys.
