Threaded Python vs. PostGreSQL plpython

From: Mike Meyer <mwm(at)mired(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Threaded Python vs. PostGreSQL plpython
Date: 2003-03-18 01:36:58
Message-ID: 15990.30778.331348.411849@guru.mired.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ok, I was a good boy and tried -interfaces first. No answer.

I'm trying to get a functioning version of plpython on FreeBSD, while
using python from the ports system.

The problem is that the ports system build python with thread
support. postmaster doesn't have thread support, so when the
libpython2.2.so is dynamically loaded, it fails to find the thread
functions, and the load fails.

The first workaround I tried was to build a custom version of the
python library that doesn't have thread support. Given that plpython
won't let me import the thread modules, this isn't a problem. However,
it does mean I have a copy of libpython2.2.so where they dynamic
loader can find it, meaning the linker will find it, meaning that
future builds of other embedded software - like apache's mod_python -
will wind up with the non-threaded library. This is a bad thing, and
I'd like to avoid it.

I tried building linking plpython.so against the static library
instead of the dynamica library, but that doesn't work properly when
loaded. I'm not sure what the problem is.

The ideal solution would be to build PostGreSQL with thread
support. I'd rather not find out the hard way that this doesn't
work. Does anyone know whether or not I can do that without mangling
PostGreSQL?

Alternatively, getting a statically linked version of plpython built
would mean I could delete the shared library. Anyone have any clues on
how to go about getting plpython built with a statically linked
libpython?

If there's another approach that might work, I'd be interested in
hearing about that as well.

Thanks,
<mike
--
Mike Meyer <mwm(at)mired(dot)org> http://www.mired.org/consulting.html
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-03-18 01:41:53 Re: My contract has been renewed
Previous Message Bruce Momjian 2003-03-18 01:34:44 Re: stats_command_string default?