I have got PostgreSQL 8.4 up and running on my Ubuntu Server 64-bit OS, but I am having difficulty with the PL/Python functions from my database. In particular, I am running this:
------------------------------------------------------- drop language plpythonu cascade; create language plpythonu;
-- Utility CREATE OR REPLACE FUNCTION min_float(a float, b float) RETURNS float AS $$ return min(a,b); $$ LANGUAGE plpythonu;
------------------------------------------------------- NOTICE: drop cascades to function min_float(double precision,double precision)
ERROR: could not load library "/opt/PostgreSQL/8.4/lib/postgresql/plpython.so": libpython2.3.so.1.0: cannot open shared object file: No such file or directory
********** Error **********
ERROR: could not load library "/opt/PostgreSQL/8.4/lib/postgresql/plpython.so": libpython2.3.so.1.0: cannot open shared object file: No such file or directory SQL state: 58P01 -------------------------------------------------------
The strange thing is that I have successfully created plpythonu language and the PLPythonu function(s). I was originally having difficulty getting PL/Python to install and it was throwing a similar error. However, this everntually went away once I added the PostgreSQL root install dir to the PATH variable (in my .bashrc and .bash_profile). I have both Python26 and Python31 installed (both came with ubuntu I believe).
I am not sure that I have put my PATH and LD_LIBRARY_PATH settings into the correct .bash_profile and .bashrc files so that PgAdmin3 and psql (being opened by other users) will have the correct settings.