Re: German "umlaut insensitive" query

From: Robert Strötgen <robert(at)stroetgen(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: German "umlaut insensitive" query
Date: 2004-09-01 15:17:09
Message-ID: 4135E7F5.4070002@stroetgen.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> select replace( replace( replace( replace( 'Test ä ö ü ß', 'ä','ae'),
> 'ö','oe' ), 'ü','ue'), 'ß','ss' );

Thanks a lot. A wrote this into a user defined function with lower()
around the source string, and it works. :-)

CREATE OR REPLACE FUNCTION public.unumlaut(varchar)
RETURNS varchar AS
'select replace( replace( replace( replace( lower($1), \'ä\',\'ae\'),
\'ö\',\'oe\' ), \'ü\',\'ue\'), \'ß\',\'ss\' );'
LANGUAGE 'sql' IMMUTABLE STRICT;

Best regards,
Robert. :)

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Robert Strötgen
mailto:robert(at)stroetgen(dot)de http://www.stroetgen.de/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message John DeSoi 2004-09-01 15:57:33 Re: colored PL with emacs
Previous Message Erik Wasser 2004-09-01 15:14:49 Extracting fieldnames from a TABLE