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

查看:82
本文介绍了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 I get:

错误:语言plpythonu"不存在

当我尝试创建扩展时:

CREATE EXTENSION plpythonu

我收到错误:无法访问文件$libdir/plpython2":没有那个文件或目录经过大量搜索和挖掘博客文章后,我尝试安装其他软件包,并将所有 plpython 文件从/usr/share/postgresql/9.1/extension 复制到/opt/bitnami/postgresql/share/extension PostgreSQL 似乎正在寻找他们.这至少让我达到了 PostgreSQL 实际上看到可用扩展的地步.当我跑步时:

I get ERROR: could not access file "$libdir/plpython2": No such file or directory 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 a point at which PostgreSQL actually sees the available extensions. When I run:

SELECT name, default_version, installed_version FROM pg_available_extensions WHERE name LIKE('plpy*')

我明白了:

    name    | default_version | installed_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!

推荐答案

您正在使用 /opt 中来自 Bitnami 的 PostgreSQL 包.不清楚您是使用 apt-get 还是通过安装程序脚本/程序安装了它,但在任何一种情况下,它都与 Ubuntu postgresql 包中的 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 支持与你实际使用的不同.

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 支持(如果可用).它可能不是由 Bitnami 提供的.

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天全站免登陆