Thread: problem with pl/python in 7.2.2

problem with pl/python in 7.2.2

From
junk@ns1.tcu-inc.com
Date:
Hello!

I am having a problem with PostgreSQL 7.2.2 which does not happen with
7.2.

Basically, I have Python 2.2.1 and PG 7.2.2installed on a RedHat 7.3 box where
importing the re module into a python procedure doesn't work.

When I try the same thing on a RedHat 7.1 with PG 7.2 iwht Python 2.2.1,
 it works.

Below if the error code I get. What is really weird, is that I can import
other modules like sys, os, and string and they work fine.
Here is the error code I get.

drop function replace_e_to_a(text);
DROP
postgres=# CREATE FUNCTION replace_e_to_a(text) RETURNS text AS
postgres-# '
postgres'#
postgres'# import re
postgres'# return ''this is a test''
postgres'# '
postgres-# LANGUAGE 'plpython';
CREATE
postgres=#
postgres=# select replace_e_to_a('text');
ERROR:  plpython: Call of function `__plpython_procedure_replace_e_to_a_16596' failed.
exceptions.ImportError: No module named _sre

Thanks!
Mark