Threaded python vs. plpython - Mailing list pgsql-interfaces

From Mike Meyer
Subject Threaded python vs. plpython
Date
Msg-id 15989.18444.184517.882610@guru.mired.org
Whole thread Raw
List pgsql-interfaces
In trying to build plpython on FreeBSD, I ran into a nasty gotcha.

If I build a dynamic library from the static library built by the
port, the createlang fails because the resulting .so file is looking
for the posix threads library code. On FreeBSD, this is in libc_r, and
a compiler flag causes the compiler to link against that instead of
libc.

The obvious solution is to build python without threads, but that's
not acceptable, as I use them fairly regularly.

Building a custom python config just to create a shared library for
plpython works, but then I can't load the modules that are binary
code. Given that plpython has a short list of modules that can be
imported, this can be made to work, but is really ugly.

I was hoping someone had a better solution. Or maybe had built
PostGreSQL with the -pthread flag on FreeBSD, and knew how that
worked.
Thanks,<mike
-- 
Mike Meyer <mwm@mired.org>        http://www.mired.org/consulting.html
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.


pgsql-interfaces by date:

Previous
From: "ff"
Date:
Subject: persistent variables between cross-calls in C functions
Next
From: "Dave Page"
Date:
Subject: Re: [HACKERS] Upgrading the backend's error-message infrastructure