Martín Marqués writes:
> select count(*) from tab1 where col1 LIKE '%mas%'
>
> but I would like it to catch rows with "más" also.
>
> The only thing I can think of is makeing a function that applied to col1
> would give me col1 but without accents. Say the function is called
> no_accents, so:
>
> no_accents(más)=mas
>
> Now, the problem is that I have little idea on making such a function. Is it
> very difficult?
CREATE FUNCTION no_accents(text) RETURNS text AS '
my $arg = $_[0];
$arg =~ tr/áéëíñóú/aeeinou/;
return $arg;
' LANGUAGE 'plperl';
Something similar should be possible in PL/Tcl if you prefer that. Or you
bother with C and run a simple loop over the text string.
--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter