pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: c k <shreeseva.learning@gmail.com>
Cc: pgsql-general@postgresql.org, pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: postgresql server crash on windows 7 when using plpython
Date: Wed, 10 Aug 2011 14:37:29 +0800
Message-ID: <4E422729.7000007@ringerc.id.au> (raw)
In-Reply-To: <CAN2Y=uMs3SwWwogKpazMPKFTbuJZngOhaDLxYg+XReJK=BzpPA@mail.gmail.com>
References: <CAN2Y=uMs3SwWwogKpazMPKFTbuJZngOhaDLxYg+XReJK=BzpPA@mail.gmail.com>

On 9/08/2011 10:54 PM, c k wrote:

> Normal python functions returning text etc. are working but when conatining
>
> import sys
> from uuid import getnode as get_mac
> mac = get_mac()
> return mac
>
> fails. What will be the reason?

You still haven't supplied the error message you get when you run this.

In the absence of better information, my guess would be that python's 
uuid module uses ossp-uuid, same as PostgreSQL does, but a different 
version or one compiled differently. The PostgreSQL `bin' dir with the 
postgresql version of the DLL will be in the path before the Python one, 
so Python is calling into a different version of the DLL than it expects 
and probably crashing as a result.

That would be consistent with it working from the python command line.

To work around this, I'd either use the ossp-uuid functions via the SPI 
rather than using the Python UUID module, or I'd remove the OSSP-UUID 
dll from the postgresql directory. You can certainly try that to see if 
it helps.

This is one of the joys you get with Windows software not being managed 
by a central packaging system. Everyone bundles their own versions of 
all the dependencies, leaving messes like this where two DLLs with the 
same name aren't quite compatible. Yay!

--
Craig Ringer



view thread (20+ messages)  latest in thread

Message-ID: <4E422729.7000007@ringerc.id.au>
Permalink:  ../4E422729.7000007@ringerc.id.au/
Also on:    postgresql.org/message-id/4E422729.7000007@ringerc.id.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ringerc@ringerc.id.au, shreeseva.learning@gmail.com
  Subject: Re: postgresql server crash on windows 7 when using plpython
  In-Reply-To: <4E422729.7000007@ringerc.id.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox