On Wed, Nov 21, 2007 at 09:14:14AM +0100, Bart Degryse wrote:
> I would do something like this (not tested, but conceptually working):
>  
> CREATE or replace FUNCTION sanitize_text(webtext IN text, cleantext OUT text) 
> AS
> $body$
> BEGIN
> cleantext = translate(webtext, E'\x92\x96', '''-');
> cleantext = regexp_replace(cleantext, E'\x9c', 'oe', 'g');
> cleantext = regexp_replace(cleantext, E'\x85', '...', 'g');
> END;
> $body$
> LANGUAGE plpgsql VOLATILE RETURNS NULL ON NULL INPUT;

Hi, 

I was curious as to why you created this function with a prototype of 

        func(intext IN text, outtext OUT text) ... returns NULL

instead of the usual

        func(intext text) ... returns TEXT 

Is that a more efficient way?

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to