PostgreSQL:如何安装 plpythonu 扩展

编程入门 行业动态 更新时间:2024-10-25 04:17:49
本文介绍了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,你可以使用来自 apt.postgresql 的推荐包/ .

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

更多推荐

PostgreSQL:如何安装 plpythonu 扩展

本文发布于:2023-10-16 00:08:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1495897.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:PostgreSQL   plpythonu

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!