【问题标题】:Install plpython3u for PostgreSQL 9.5 on CentOS 7.2在 CentOS 7.2 上为 PostgreSQL 9.5 安装 plpython3u
【发布时间】:2020-08-14 18:52:39
【问题描述】:

尽我所能,我没有成功在 PostgreSQL 9.5 x64 安装上安装 plpython3u 扩展。

从 pgdg 存储库安装的 PostgreSQL 9.5:

[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

python 3.5 安装为:

[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

当我尝试在数据库中启用 plpython3u 时:

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

这有关系吗?

[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

感谢您的帮助...把头发拉出来。

编辑

由于某种原因似乎没有安装...!?

[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

还有:

[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

【问题讨论】:

  • 使用能力:sudo apt-get install postgresql-plpython3-9.5。 yum 似乎使用了不同的命名约定。
  • 我从 PGDG 仓库安装的 postgresql95-plpython.x86_64 不够用?
  • 没有。 postgresql95-plpython.x86_64 适用于 plpythonu & plpython2u 但不适用于 plpython3u。这就是为什么您会收到消息“无法打开扩展控制文件...”。这些文件附带适当的软件包(如果它不包含在标准安装中)。例如,查看 Red Hat / Centos / Scientific Linux 的 PostGIS installation
  • @Abelisto - 我有 sudo apt list --installed | grep postgres postgresql/bionic,bionic,now 10+190 all [已安装] postgresql-10/bionic-updates,bionic-security,now 10.6-0ubuntu0.18.04.1 amd64 [已安装,自动] postgresql-client-10/bionic-更新,仿生安全,现在 10.6-0ubuntu0.18.04.1 amd64 [已安装,自动] postgresql-client-common/bionic,仿生,现在 190 所有 [已安装] postgresql-common/bionic,仿生,现在 190 所有 [已安装,自动] postgresql-contrib/bionic,bionic,now 10+190 all [已安装]
  • @Abelisto postgresql-plpython-10/bionic-updates,bionic-security,now 10.6-0ubuntu0.18.04.1 amd64 [已安装] postgresql-plpython3-10/bionic-updates,bionic-security,现在 10.6-0ubuntu0.18.04.1 amd64 [已安装] 仍然错误:无法打开扩展控制文件“/usr/share/postgresql/10/extension/plpython3u.control”:没有这样的文件或目录

标签: python postgresql centos postgresql-9.5 plpython


【解决方案1】:

尝试使用 yum

yum install postgresql95-contrib postgresql95-plpython3

【讨论】:

    猜你喜欢
    • 2018-11-07
    • 1970-01-01
    • 1970-01-01
    • 2019-06-22
    • 2016-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-06
    相关资源
    最近更新 更多