简体   繁体   English

在 postgresql 8 或 9 中安装 plpython

[英]install plpython in postgresql 8 or 9

i want to install plpython on postgresql to have python trigger我想在 postgresql 上安装 plpython 以获得 python 触发器

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):当我恢复我的数据库时(我的数据库有一些 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.

Command was:命令是:

CREATE OR REPLACE PROCEDURAL LANGUAGE plpythonu;

It looks like you need to put plpython.dll in C:/Program Files/PostgreSQL/9.0/lib .看起来您需要将plpython.dll放入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.检查我的C:\Program Files\PostgreSQL\8.2\lib显示我在那里有plpython.dll As your error says, it looks like plpython.dll is missing from the lib folder of your postgresql installation.正如您的错误所说,您的 postgresql 安装的 lib 文件夹中似乎缺少plpython.dll

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM