As discussed in Postgres BUG #5232 assigning values to the parameters fails with the following error:
Detail: <type 'exceptions.UnboundLocalError'>: local variable 'src' referenced before assignment
If assignment to the parameter is still needed one can solve the issue by adding
global
definition for such a parameter. CREATE OR REPLACE FUNCTION pyreplace(src text, s text) RETURNS text AS $BODY$ global src src=src.replace(s,'') return src $BODY$ LANGUAGE 'plpythonu' VOLATILE COST 100;
No comments:
Post a Comment