在 postgresql 8 或 9 中安装 plpython

发布于 2024-11-05 02:34:32 字数 1024 浏览 2 评论 0原文

我想在 postgresql 上安装 plpython,以便

在恢复数据库时拥有 python 触发器(我的数据库有一些 python 触发器),出现此错误(错误消息太大,所以我粘贴了它的第一行):

C:/Program Files/PostgreSQL/9.0/bin/pg_restore.exe
   --host localhost
   --port 5432
   --username "postgres"
   --dbname "mfa"
   --verbose
   "%HOMEPATH%/Desktop/EhSAA/MFA/db_schema/mydb.backup"

pg_restore: connecting to database for restore
pg_restore: creating SCHEMA public
pg_restore: creating COMMENT SCHEMA public
pg_restore: creating PROCEDURAL LANGUAGE plpgsql
pg_restore: creating PROCEDURAL LANGUAGE plpythonu
pg_restore: [archiver (db)] Error while PROCESSING TOC:

pg_restore: [archiver (db)] Error from TOC entry 315; 2612 16595
                                  PROCEDURAL LANGUAGE plpythonu postgres

pg_restore: [archiver (db)] could not execute query:
ERROR: could not load library "C:/Program Files/PostgreSQL/9.0/lib/plpython.dll":
The specified module could not be found.

命令是:

CREATE OR REPLACE PROCEDURAL LANGUAGE plpythonu;

i want to install plpython on postgresql to have python trigger

when i restore my DB (my db has some python trigger) this error apears (error message was too big so i paste first lines of it):

C:/Program Files/PostgreSQL/9.0/bin/pg_restore.exe
   --host localhost
   --port 5432
   --username "postgres"
   --dbname "mfa"
   --verbose
   "%HOMEPATH%/Desktop/EhSAA/MFA/db_schema/mydb.backup"

pg_restore: connecting to database for restore
pg_restore: creating SCHEMA public
pg_restore: creating COMMENT SCHEMA public
pg_restore: creating PROCEDURAL LANGUAGE plpgsql
pg_restore: creating PROCEDURAL LANGUAGE plpythonu
pg_restore: [archiver (db)] Error while PROCESSING TOC:

pg_restore: [archiver (db)] Error from TOC entry 315; 2612 16595
                                  PROCEDURAL LANGUAGE plpythonu postgres

pg_restore: [archiver (db)] could not execute query:
ERROR: could not load library "C:/Program Files/PostgreSQL/9.0/lib/plpython.dll":
The specified module could not be found.

Command was:

CREATE OR REPLACE PROCEDURAL LANGUAGE plpythonu;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鹿童谣 2024-11-12 02:34:32

看来您需要将 plpython.dll 放入 C:/Program Files/PostgreSQL/9.0/lib 中。我刚刚在我的系统上尝试了以下命令,它起作用了。

cd C:\Program Files\PostgreSQL\8.2\bin
createlang --dbname=MyDb plpythonu -U myuser

检查我的 C:\Program Files\PostgreSQL\8.2\lib 发现我有 plpython.dll 在那里。正如您的错误所示,您的 postgresql 安装的 lib 文件夹中似乎缺少 plpython.dll 。

It looks like you need to put plpython.dll in C:/Program Files/PostgreSQL/9.0/lib. I just tried the following commands on my system, and it worked.

cd C:\Program Files\PostgreSQL\8.2\bin
createlang --dbname=MyDb plpythonu -U myuser

Checking into my C:\Program Files\PostgreSQL\8.2\lib reveals that I have plpython.dll in there. As your error says, it looks like plpython.dll is missing from the lib folder of your postgresql installation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文