Install plpython3u for PostgreSQL 9.5 on CentOS 7.

2019-07-04 11:16发布

问题:

Try as I might, I have not succeeded in installing the plpython3u extension on a PostgreSQL 9.5 x64 install.

PostgreSQL 9.5 installed from pgdg repo:

[joe@postgresql ~]$ yum list installed | grep pgdg
CGAL.x86_64                          4.7-1.rhel7                 @pgdg95
SFCGAL.x86_64                        1.2.2-1.rhel7               @pgdg95
SFCGAL-libs.x86_64                   1.2.2-1.rhel7               @pgdg95
geos.x86_64                          3.5.0-1.rhel7               @pgdg95
pgdg-centos95.noarch                 9.5-2                       installed
plv8_95.x86_64                       1.4.4-1.rhel7               @pgdg95
postgis2_95.x86_64                   2.2.2-1.rhel7               @pgdg95
postgis2_95-client.x86_64            2.2.2-1.rhel7               @pgdg95
postgresql95.x86_64                  9.5.3-2PGDG.rhel7           @pgdg95
postgresql95-contrib.x86_64          9.5.3-2PGDG.rhel7           @pgdg95
postgresql95-devel.x86_64            9.5.3-2PGDG.rhel7           @pgdg95
postgresql95-libs.x86_64             9.5.3-2PGDG.rhel7           @pgdg95
postgresql95-plpython.x86_64         9.5.3-2PGDG.rhel7           @pgdg95
postgresql95-server.x86_64           9.5.3-2PGDG.rhel7           @pgdg95

And python 3.5 installed as:

[joe@postgresql ~]$ yum list installed | grep python35
python35u.x86_64                     3.5.2-1.ius.centos7            @ius
python35u-devel.x86_64               3.5.2-1.ius.centos7            @ius
python35u-libs.x86_64                3.5.2-1.ius.centos7            @ius
python35u-pip.noarch                 8.1.2-1.ius.centos7            @ius
python35u-setuptools.noarch          22.0.5-1.ius.centos7           @ius

When I try to enable plpython3u in a database:

psql (9.5.3)
Type "help" for help.

postgres=# create extension plpython3u;
ERROR:  could not open extension control file "/usr/pgsql-9.5/share/extension/plpython3u.control": No such file or directory
postgres=# \q

Does this have something to do with it?

[joe@postgresql ~]$ which python
/usr/bin/python
[joe@postgresql ~]$ ls /usr/bin/pyt* -l
lrwxrwxrwx. 1 root root     7 Jul 15 23:05 /usr/bin/python -> python2
lrwxrwxrwx. 1 root root     9 Jul 15 23:05 /usr/bin/python2 -> python2.7
-rwxr-xr-x. 1 root root  7136 Nov 19  2015 /usr/bin/python2.7
-rwxr-xr-x. 2 root root 11304 Jun 27 12:05 /usr/bin/python3.5
lrwxrwxrwx. 1 root root    26 Jul 16 18:14 /usr/bin/python3.5-config -> /usr/bin/python3.5m-config
-rwxr-xr-x. 2 root root 11304 Jun 27 12:05 /usr/bin/python3.5m
-rwxr-xr-x. 1 root root   173 Jun 27 12:04 /usr/bin/python3.5m-config
-rwxr-xr-x. 1 root root  3398 Jun 27 12:02 /usr/bin/python3.5m-x86_64-config

My thanks for the help... pulling hair out on this.

EDIT

Sure doesn't appear to be installed for some reason...!?

[joe@postgresql ~]$  ls -l /usr/pgsql-9.5/lib/plp*
-rwxr-xr-x. 1 root root 174352 May 14 15:49 /usr/pgsql-9.5/lib/plpgsql.so
-rwxr-xr-x. 1 root root 123632 May 14 15:49 /usr/pgsql-9.5/lib/plpython2.so

And also:

[joe@postgresql ~]$ ls -l /usr/pgsql-9.5/share/extension/plp*
-rw-r--r--. 1 root root 332 May 14 15:44 /usr/pgsql-9.5/share/extension/plpgsql--1.0.sql
-rw-r--r--. 1 root root 179 May 14 15:44 /usr/pgsql-9.5/share/extension/plpgsql.control
-rw-r--r--. 1 root root 381 May 14 15:44 /usr/pgsql-9.5/share/extension/plpgsql--unpackaged--1.0.sql
-rw-r--r--. 1 root root 351 May 14 15:45 /usr/pgsql-9.5/share/extension/plpython2u--1.0.sql
-rw-r--r--. 1 root root 196 May 14 15:45 /usr/pgsql-9.5/share/extension/plpython2u.control
-rw-r--r--. 1 root root 402 May 14 15:45 /usr/pgsql-9.5/share/extension/plpython2u--unpackaged--1.0.sql
-rw-r--r--. 1 root root 347 May 14 15:45 /usr/pgsql-9.5/share/extension/plpythonu--1.0.sql
-rw-r--r--. 1 root root 194 May 14 15:45 /usr/pgsql-9.5/share/extension/plpythonu.control
-rw-r--r--. 1 root root 393 May 14 15:45 /usr/pgsql-9.5/share/extension/plpythonu--unpackaged--1.0.sql