Nabil,
> Has somebody a pl/pgsql function for search/replace by hand ?
> I heard that 7.3 can do this with plain sql, but unfortunately 7.3 is
> only available in unstable (debian) at the moment.
> So I have to stick to 7.2
I don't know about this ... search and replace is so easy in PL/perl, why
don't you use that?
CREATE FUNCTION strswap(
TEXT, VARCHAR, VARCHAR )
RETURNS TEXT AS '
my($the_text, $look_up, $replace_with) = @_;
$the_text =~ s:$look_up:$replace_with:eg ;
return $the_text;
' LANGUAGE 'plperl' WITH (ISCACHABLE, ISSTRICT);
--
-Josh Berkus
Aglio Database Solutions
San Francisco