8

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;
1
  • 1
    Format your output properly - otherwise this posting is a disaster Commented May 4, 2011 at 17:27

1 Answer 1

6

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.

Sign up to request clarification or add additional context in comments.

6 Comments

my postgres is 9 and when i use above command, i get errors :(
Remove the leading > on the lines. That was there to show the command prompt. Also, change 8.2 to whatever version your dir is. Lastly, ensure that plpython.dll is actually inside C:\Program Files\PostgreSQL\x.x\bin
Did you make sure that plpython.dll is in the lib folder?
Lastly, ensure that plpython.dll is actually inside C:\Program Files\PostgreSQL\x.x\bin I made an error on this comment above, sorry, it's actually C:\Program Files\PostgreSQL\x.x\lib.
i found the solution, all these problems are related to my x64 postgresql and its x86 dll s. thanks so much for your realtime helping :)
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.