pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-sql@postgresql.org
Cc: Hélder M. Vieira <hmv@mail.telepac.pt>
Subject: Re: Locale and pattern matching
Date: Thu, 8 Dec 2005 09:21:49 +0100
Message-ID: <200512080921.49722.peter_e@gmx.net> (raw)
In-Reply-To: <001801c5fb98$025ac0f0$580bfea9@hmv02>
References: <001801c5fb98$025ac0f0$580bfea9@hmv02>

Hélder M. Vieira wrote:
> For instance, if the pattern specifies an uppercase 'A' with an
> accute accent, then it will match a lowercase 'A' with an accute
> accent, but not an upper or lower case 'A' with a tilde.
> This behaviour seems inconsistent with that of the ORDER BY clause,
> which considers all forms of a vowel as equal

This is not exactly true.  Sorting just goes through the strings in 
multiple passes, looking at the "general" letter first, then at the 
case, then at the accents, until it finds a difference.

> Shouldn't case insensitive pattern matching follow the same collation
> weights that ORDER BY uses ?

Even if it did, it would not help you, as explained above.  Moreover, 
the collation rules of some locales are sufficiently weird that a 
consistent behavior between sorting and pattern matching is impossible 
to achieve.

> Until now, I've been selecting LATIN1 encoding, but after a few
> tests, I came to think that LATIN9 is a better option (the euro
> sign...). For those who regularly use LATIN9, what is your opinion ?
> Is it indeed a better option ?

Yes.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/



view thread (2+ messages)

Message-ID: <200512080921.49722.peter_e@gmx.net>
Permalink:  ../200512080921.49722.peter_e@gmx.net/
Also on:    postgresql.org/message-id/200512080921.49722.peter_e@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: peter_e@gmx.net, hmv@mail.telepac.pt
  Subject: Re: Locale and pattern matching
  In-Reply-To: <200512080921.49722.peter_e@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox