Re: Collation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Moritz Schepp <moritz(dot)schepp(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Collation
Date: 2016-06-11 15:43:08
Message-ID: 17353.1465659788@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Moritz Schepp <moritz(dot)schepp(at)gmail(dot)com> writes:
> My problem is that I don't (even) get the german collation to work, the
> following query yields 'f':

> SELECT 'a' COLLATE "german" LIKE 'ä' COLLATE "german";

> Shouldn't that be working?

No. Postgres interprets COLLATE as having to do only with sort ordering.
What you want here, IIUC, is to do accent-stripping on the data and/or the
LIKE pattern before you compare them. Take a look at the contrib/unaccent
module for one solution.

regards, tom lane

In response to

  • Collation at 2016-06-11 12:22:56 from Moritz Schepp

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jim McNamara 2016-06-14 17:25:51 Fwd: pgadmin doesn't see tables?
Previous Message Moritz Schepp 2016-06-11 12:22:56 Collation