PostgreSQL:如何安装plpythonu扩展 [英] PostgreSQL: how to install plpythonu extension

查看:1179
本文介绍了PostgreSQL:如何安装plpythonu扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Ubuntu 12.04.4上运行PostgreSQL 9.3.1。我想使用plpython语言扩展,但是在尝试使用它时出现错误:

I'm running PostgreSQL 9.3.1 on Ubuntu 12.04.4. I'd like to use the plpython language extension but I get an error when I try to use it:

错误:语言 plpythonu可以不存在

当我尝试创建扩展名时:

When I try to create the extension:

创建扩展plpythonu

...我收到错误:
错误:无法访问文件 $ libdir / plpython2:没有这样的文件或目录

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

经过大量搜索和挖掘,我尝试安装其他文件软件包,并将所有plpython文件从/usr/share/postgresql/9.1/extension复制到/ opt / bitnami / postgresql / share / extension,而PostgreSQL似乎在寻找它们。至少这使我到达了PostgreSQL看到可用扩展的地方。当我运行时:

After much searching and digging through blog posts I've tried installing additional packages and have 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. That at least got me to where PostgreSQL sees the available extensions. When I run:

从pg_available_extensions中选择名称,default_version,installed_version,其中的名称类似于 plpy *

我得到:


名称| default_version |已安装版本
------------ + ----------------- + -------------- -----
plpython2u | 1.0 |
plpython3u | 1.0 |
plpythonu | 1.0 |

在/ opt / bitnami / postgresql / lib中仍然看不到plpython库。有人可以帮助我完成其余步骤以使扩展程序正常工作吗?

There are still no plpython libraries that I can see in /opt/bitnami/postgresql/lib. Can anybody help me get through remaining steps to make the extension work? Thanks in advance!

推荐答案

您正在使用Bitnami的PostgreSQL软件包,位于 / opt 。目前尚不清楚是使用 apt-get 还是通过安装程序脚本/程序安装的,但是在这两种情况下,它都不是与Ubuntu <$ c $相同的PostgreSQL。 c> postgresql 软件包。

You're using a PostgreSQL package from Bitnami, in /opt. It's not clear if you installed this with apt-get or via an installer script/program, but in either case it's not the same PostgreSQL as what's in the Ubuntu postgresql package.

安装 postgresql-plpython 不会做任何事情很好,因为您要安装的PL / Python支持与实际使用的PostgreSQL安装不同。

Installing postgresql-plpython won't do you any good, because you're installing PL/Python support for a different PostgreSQL install than the one you're actually using.

您将需要使用相同的安装方法您最初用于安装Bitnami PostgreSQL以添加PL / Python支持(如果可用)。

You'll need to use the same installation method you originally used to install the Bitnami PostgreSQL to add PL/Python support, if it's available. It might not be provided by Bitnami.

否则,如果您不太喜欢使用Bitnami的PostgreSQL,则可以使用 http://apt.postgresql.org/

Otherwise, if you're not too attached to using Bitnami's PostgreSQL, you could use the recommended packages from http://apt.postgresql.org/ .

这篇关于PostgreSQL:如何安装plpythonu扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆