From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Morris de Oryx <morrisdeoryx@gmail.com>
Cc: Rob Sargent <robjsargent@gmail.com>
Cc: wim.bertels@ucll.be
Cc: Steve Haresnape <s.haresnape@creativeintegrity.co.nz>
Cc: pgsql-general\@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Camel case identifiers and folding
Date: Sat, 16 Mar 2019 21:11:06 +0000
Message-ID: <87bm2a6233.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <CAKqnccjCHNCfHaZGOPFQ3OVLNuw4VhnP6oTKJi87L8at=f0WDA@mail.gmail.com>
References: <CAJrKPxc69dMNJAE=3Y5mG56sXwQLRqXZnN4inZQ3EXdwZFqH2Q@mail.gmail.com>
<1552641160.5846.2.camel@ucll.be>
<CAKqnccin-0hXKM8q527kvSG=pOGrqUZy2VHsZd4-dWOc29nG=w@mail.gmail.com>
<7D62A9A2-C784-47A9-96BC-5949D0C8348E@gmail.com>
<CAKqnccjCHNCfHaZGOPFQ3OVLNuw4VhnP6oTKJi87L8at=f0WDA@mail.gmail.com>
>>>>> "Morris" == Morris de Oryx <morrisdeoryx@gmail.com> writes:
Morris> UUIDs as a type are an interesting case in Postgres. They're
Morris> stored as a large numeric for efficiency (good!), but are
Morris> presented by default in the 36-byte format with the dashes.
Morris> However, you can also search using the dashes 32-character
Morris> format....and it all works. Case-insensitively.
That works because UUIDs have a convenient canonical form (the raw
bytes) which all input is converted to before comparison.
Text is ... not like this.
Even citext is really only a hack - it assumes that comparisons can be
done by conversion to lowercase, which may work well enough for English
but I'm pretty sure it does not correctly handle the edge cases in, for
example, German (consider 'SS', 'ss', 'ß') or Greek (final sigma). Doing
it better would require proper application of case-folding rules, and
even that would require handling of edge cases (the Unicode case folding
algorithm is designed to be language-independent, which means that it
breaks for Turkish without special-case exceptions).
--
Andrew (irc:RhodiumToad)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: andrew@tao11.riddles.org.uk, morrisdeoryx@gmail.com, robjsargent@gmail.com, wim.bertels@ucll.be, s.haresnape@creativeintegrity.co.nz
Subject: Re: Camel case identifiers and folding
In-Reply-To: <87bm2a6233.fsf@news-spur.riddles.org.uk>
References: <CAJrKPxc69dMNJAE=3Y5mG56sXwQLRqXZnN4inZQ3EXdwZFqH2Q@mail.gmail.com> <1552641160.5846.2.camel@ucll.be> <CAKqnccin-0hXKM8q527kvSG=pOGrqUZy2VHsZd4-dWOc29nG=w@mail.gmail.com> <7D62A9A2-C784-47A9-96BC-5949D0C8348E@gmail.com> <CAKqnccjCHNCfHaZGOPFQ3OVLNuw4VhnP6oTKJi87L8at=f0WDA@mail.gmail.com> <87bm2a6233.fsf@news-spur.riddles.org.uk>
* 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