I should post this as a comment to Peter Eisentraut's answer, but I keep hitting enter and then accidentally post before the comment is finished; also, I want to add some links and other stuff:
I ended up doing exactly what Peter recommended - both rebuilding from source and posting this issue in the EnterpriseDB forum. For some reason, my forum post showed up under some username I've never heard before, I could even read all posts of that user. Maybe he/she was logged in before me, looks like a pretty massive bug in their forum software to me :-(
Anyway, building the plpython binary involves nothing more than download the latest PostgreSQL source code, unpack it and pass some parameters to configure
as documented:
configure --with-python PYTHON=/usr/bin/python2.6
Then, run make
to build. Despite the fact that the default Python version on my system is 2.6 and I explicitely pass that as parameter, configure prints this message
checking for python... /usr/bin/python2.6
checking for Python distutils module... yes
checking Python configuration directory... /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config
checking how to link an embedded Python application... -L/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config -lpython2.6 -ldl
checking whether Python is compiled with thread support... yes
but the built binary anyway uses a Python 2.7 installation I didn't even remember I had installed:
otool -L <postgres build dir>/src/pl/plpython/plpython2.so
<postgres build dir>/src/pl/plpython/plpython2.so:
/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.10)
That's good enough for me, all I need is a more recent version that 2.5. Still weird.
The existing plpython binary (the one using Python 2.5) resides in the EnterpriseDB default installation directory at /Library/PostgreSQL/9.0/lib/postgresql/plpython2.so
with a symlink plpython.so
to it in the same folder. I choose to keep the original just to be on the safe side and re-symlink instead of deleting:
sudo mv plpython2.so plpython25.so
sudo cp <postgres build dir>/src/pl/plpython/plpython2.so plpython27.so
sudo ln plpython27.so plpython2.so
hmmm, maybe this should go into the wiki...