Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[BUGS] BUG #5641: Can not create any python language

176 views
Skip to first unread message

Ron Park

unread,
Sep 2, 2010, 5:33:55 PM9/2/10
to

The following bug has been logged online:

Bug reference: 5641
Logged by: Ron Park
Email address: rpa...@gmail.com
PostgreSQL version: 9.0
Operating system: Windows 7 professional 64 bit
Description: Can not create any python language
Details:

when trying to create plpythonu

ERROR: could not find function "plpython_call_handler" in file "C:/Program
Files/PostgreSQL/9.0/lib/plpython.dll"


when trying to create plpython2u or plpython3u I get
ERROR: could not access file "$libdir/plpython2": No such file or
directory

ERROR: could not access file "$libdir/plpython3": No such file or
directory


I have python2.6, python3.1, python3.2 all installed (64 bit). All are in
the path variable.

used 9.0 MSI from enterprise to install postgresql 9.0

I have been running and using the 8.xx ones on windows 32 bit and ubuntu for
6 years and have been able to get python to behave well on both systems.
But I am at a loss here.. Looks like there is a bug in the plpython.dll
missing the call handler??? Not sure

--
Sent via pgsql-bugs mailing list (pgsql...@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Ashesh Vashi

unread,
Sep 9, 2010, 5:55:15 AM9/9/10
to
Hi,

Can you share the postgresql log file, when you tried to create the python language on PG 9.0?

--
Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA

Ashesh Vashi

unread,
Sep 9, 2010, 9:25:43 AM9/9/10
to
Hi Ron,

I am able to reproduce the issue on my side..
Thanks for the report.

I found that - plpython.dll is not exporting any plpython_call_handler function, but plpython3_call_handler.

For the work around, you can follow this link:
1) Go to PostgreSQL lib directory
    i.e. C:\Program Files\PostgreSQL\9.0\lib
2) Copy plpython.dll as plpython3.dll in the same directory.

Now, try to create the plpython3u language in PostgreSQL.
i.e. CREATE LANGUAGE plpython3u;

This is just a temporary solution and I wish - this solves the problem for you.
We will come up with a better solution soon.

--
Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise Postgres Company

areveille

unread,
Jan 6, 2011, 9:08:11 AM1/6/11
to

Hi,

I'm facing the same issue in the same environment and the solution given by
Ashesh Vashi is not working. :(
Once I have copied plpython.dll as plpython3.dll, I still can't create the
language plpython3u for a database.

Is there another work around?

Thanks,

Alban.
--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-5641-Can-not-create-any-python-language-tp2801518p3330444.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

Ashesh Vashi

unread,
Jan 6, 2011, 9:36:24 AM1/6/11
to
Hi Alban,

Can you please open the plpython.dll (now, plpython3.dll) in the dependency walker and check if it satisfies all the required dlls?
You can find the dependency walker @ dependencywalker.com.

--
Thanks & Regards,


Ashesh Vashi

Robert Haas

unread,
Jan 6, 2011, 9:37:12 AM1/6/11
to
On Thu, Jan 6, 2011 at 9:08 AM, areveille <arev...@mobigis.fr> wrote:
> I'm facing the same issue in the same environment and the solution given by
> Ashesh Vashi is not working. :(
> Once I have copied plpython.dll as plpython3.dll, I still can't create the
> language plpython3u for a database.

I guess the obvious question is - what happens when you try it?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Ashesh Vashi

unread,
Jan 6, 2011, 9:42:02 AM1/6/11
to
It shows you all the dependent dlls (present or missing) in it.
It also shows the exported functions by that particular dll.

That gives you idea, if something is wrong with your environment or some dlls are missing.

You can check more details on http://dependencywalker.com/
(NOTE: bottom of the page of this link shows you the screen-shot of dependency walker.)

--
Thanks & Regards,


Ashesh Vashi

areveille

unread,
Jan 6, 2011, 10:12:46 AM1/6/11
to

Hi,

I used dependency walker in order to see which dependencies could be
unsatified in plpython.dll and indeed some of them were missing :
- python26.dll (I had python2.7 installed but obviously it requires 2.6.)
- some .dll that are in the bin folder of posgreSQL

So I installed python 2.6 and copy/paste the other missing dlls

In the end, when I use dependency walker, plpython.dll still have a warning
:
"Warning: At least one module has an unresolved import due to a missing
export function in a delay-load dependent module."
Here is a screen shot of the result in dependency walker :
http://postgresql.1045698.n5.nabble.com/file/n3330551/depWalker.png
depWalker.png

I still can't create the language.

Thanks,

Alban.
--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-5641-Can-not-create-any-python-language-tp2801518p3330551.html


Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

--

areveille

unread,
Jan 6, 2011, 10:15:09 AM1/6/11
to

The result is still the same (means "ERREUR: n'a pas pu charger la
bibliothèque « C:/Program Files/PostgreSQL/9.0/lib/plpython3.dll » : unknown
error 126" = Can't load C:/Program Files/PostgreSQL/9.0/lib/plpython3.dll
--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-5641-Can-not-create-any-python-language-tp2801518p3330556.html

Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

--

Ashesh Vashi

unread,
Jan 6, 2011, 10:18:02 AM1/6/11
to
And, make sure you create the plpythonu language not plpython3u.


--
Thanks & Regards,


Ashesh Vashi
EnterpriseDB INDIA:
Enterprise PostgreSQL Company

 

http://www.linkedin.com/in/asheshvashi



On Thu, Jan 6, 2011 at 8:46 PM, Ashesh Vashi <ashesh...@enterprisedb.com> wrote:
This warning will be there for any dlls.
So - you can ignore them.

If you have renamed the plpython.dll to plpython3.dll, then please revert it back to original one.
And, then try to create the language.


--
Thanks & Regards,


Ashesh Vashi
EnterpriseDB INDIA:
Enterprise PostgreSQL Company

 

http://www.linkedin.com/in/asheshvashi



areveille

unread,
Jan 6, 2011, 10:23:49 AM1/6/11
to

In fact I always had plpython.dll since I duplicated the file (one named
plpython.dll and the other plpython3.dll).

Anyways, now I have deleted plpython3.dll (so I just have plpython.dll) and
"create language plpython;" answers : ERREUR: n'a pas pu charger la
bibliothèque « C:/Program Files/PostgreSQL/9.0/lib/plpython.dll » : unknown
error 126 which means "can't load C:/Program
Files/PostgreSQL/9.0/lib/plpython.dll"

Thanks for your time,

Alban.
--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-5641-Can-not-create-any-python-language-tp2801518p3330575.html

Ashesh Vashi

unread,
Jan 6, 2011, 10:28:34 AM1/6/11
to
Are the python binaries in your system level PATH environment?
If not, you need to make sure the bin folder of python should be in your system level PATH variable.
Check this link for the reference: http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx

Then - you need to restart your postgres service.


--
Thanks & Regards,


Ashesh Vashi
EnterpriseDB INDIA:
Enterprise PostgreSQL Company

 

http://www.linkedin.com/in/asheshvashi



areveille

unread,
Jan 6, 2011, 11:00:45 AM1/6/11
to

This was the final step : it worked out.

Thanks for your time, your understandable explanations!

Alban,
--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-5641-Can-not-create-any-python-language-tp2801518p3330632.html

0 new messages