Hi ,
If you are getting the above ERROR message while configuring PL/PYTHON module, then please use the below steps to configure in PostgreSQL. We need to use PYTHON 3.2 Version due to some bugs in earlier version.
Step 1
=====
Download Link: http://www.activestate.com/activepython/downloads/thank-you?dl=http://downloads.activestate.com/ActivePython/releases/3.2.2.3/ActivePython-3.2.2.3-linux-x86.tar.gz"
Step 2
=====
-bash-4.1$ export PYTHONPATH=/opt/ActivePython-3.2/bin:$PATH
-bash-4.1$ export PYTHONHOME=/opt/ActivePython-3.2/
-bash-4.1$ export LD_LIBRARY_PATH=/opt/ActivePython-3.2/lib/
Step 3
=====
-bash-4.1$ ./pg_ctl -D ../data/ stop -mf
waiting for server to shut down.... done
server stopped
-bash-4.1$ ./pg_ctl -D ../data/ start
server starting
Step 4
=====
-bash-4.1$ ./psql -p 5434 postgres
Password:
psql.bin (9.1.4)
Type "help" for help.
postgres=# CREATE LANGUAGE plpython3u;
CREATE LANGUAGE
postgres=#
Step 5
=====
postgres=# CREATE OR REPLACE FUNCTION pymax (a integer, b integer) RETURNS integer AS
$$
if a > b:
return a
return b
$$ LANGUAGE plpython3u;
CREATE FUNCTION
postgres=# SELECT pymax(3,4);
pymax
-------
4
(1 row)
If you are getting the above ERROR message while configuring PL/PYTHON module, then please use the below steps to configure in PostgreSQL. We need to use PYTHON 3.2 Version due to some bugs in earlier version.
Step 1
=====
Download Link: http://www.activestate.com/activepython/downloads/thank-you?dl=http://downloads.activestate.com/ActivePython/releases/3.2.2.3/ActivePython-3.2.2.3-linux-x86.tar.gz"
Step 2
=====
-bash-4.1$ export PYTHONPATH=/opt/ActivePython-3.2/bin:$PATH
-bash-4.1$ export PYTHONHOME=/opt/ActivePython-3.2/
-bash-4.1$ export LD_LIBRARY_PATH=/opt/ActivePython-3.2/lib/
Step 3
=====
-bash-4.1$ ./pg_ctl -D ../data/ stop -mf
waiting for server to shut down.... done
server stopped
-bash-4.1$ ./pg_ctl -D ../data/ start
server starting
Step 4
=====
-bash-4.1$ ./psql -p 5434 postgres
Password:
psql.bin (9.1.4)
Type "help" for help.
postgres=# CREATE LANGUAGE plpython3u;
CREATE LANGUAGE
postgres=#
Step 5
=====
postgres=# CREATE OR REPLACE FUNCTION pymax (a integer, b integer) RETURNS integer AS
$$
if a > b:
return a
return b
$$ LANGUAGE plpython3u;
CREATE FUNCTION
postgres=# SELECT pymax(3,4);
pymax
-------
4
(1 row)
--Dinesh
Aduoliaforto Christy Learn Here
ReplyDeleteriarapseonost
Otimitemp_ku Marcus Steen Adobe Media Encoder
ReplyDeleteDaVinci Resolve 18.0.1.3
Autodesk Revit 2023 R1 v23.0.11.19
AOMEI Backupper Professional 6.9.2
sourcommpropvoi