PostgreSQL: how to install the plpythonu extension

I am running PostgreSQL 9.3.1 on Ubuntu 12.04.4. I would like to use the plpython language extension, but I get an error when I try to use it:

ERROR: language "plpythonu" does not exist

When I try to create an extension:

CREATE EXTENSION plpythonu

... I get the error: ERROR: could not access file "$libdir/plpython2": No such file or directory

After much searching and digging in the blog posts, I tried installing additional packages and copied all the plpython files from / usr / share / postgresql / 9.1 / extension to / opt / bitnami / postgresql / share / extension, where PostgreSQL seems to be looking for them. This at least led me to see PostgreSQL see the available extensions. When I run:

select name, default_version, installed_version from pg_available_extensions where name like 'plpy*'

I get:

name | default_version | installed_version ------------+-----------------+------------------- plpython2u | 1.0 | plpython3u | 1.0 | plpythonu | 1.0 |

There are still no plpython libraries that I can see in / opt / bitnami / postgresql / lib. Can someone help me go through the remaining steps to extend my work? Thanks in advance!

+11
python postgresql
source share
2 answers

You are using Bitnami's PostgreSQL package in /opt . It is not clear whether this is installed using apt-get or using the script / program installer, but in any case it is not the same PostgreSQL as in the Ubuntu postgresql package.

Installing postgresql-plpython will not do you any good, because you are installing PL / Python support for a different PostgreSQL installation than the one you are actually using.

You will need to use the same installation method that you originally used to install Bitnami PostgreSQL to add PL / Python support, if available. Perhaps this will not be provided by Bit.

Otherwise, if you are not too attached to using Bitnami PostgreSQL, you can use the recommended packages from http://apt.postgresql.org/ .

+9
source share

for postgres 11.2 (based on Debian) I needed to install:

 apt-get update && apt-get install postgresql-plpython3-11 
0
source share

All Articles