在postgresql 8或9中安装plpython

2024-06-07 14:32:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我想在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;

Tags: creating数据库db错误notarchiverrestoreprogram
1条回答
网友
1楼 · 发布于 2024-06-07 14:32:04

看起来您需要将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

相关问题 更多 >

    热门问题