"David Gardner" <dgardner(at)creatureshop(dot)com> writes:
> CREATE OR REPLACE FUNCTION pyreplace(src text,s text)
> RETURNS text AS
> $BODY$
> try:
> src=src.replace(s,'')
> return src
> except Exception,e:
> return str(e)
> $BODY$
> LANGUAGE 'plpythonu' VOLATILE
> COST 100;
Weird. You seem to need both the try block and the overwrite of the
parameter to make it misbehave. I suspect this means we're doing
something a bit wrong in setting up the python variable for the
parameter. Unfortunately I don't know enough about python to go further
than that.
regards, tom lane