Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5GaO-0001Oe-8g for pgsql-general@arkaria.postgresql.org; Sat, 16 Mar 2019 21:11:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h5GaM-0007rB-SC for pgsql-general@arkaria.postgresql.org; Sat, 16 Mar 2019 21:11:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5GaM-0007r4-GW for pgsql-general@lists.postgresql.org; Sat, 16 Mar 2019 21:11:18 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5GaJ-0006qy-Cr for pgsql-general@postgresql.org; Sat, 16 Mar 2019 21:11:17 +0000 Received: from [192.168.127.1] (port=53576 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1h5GaD-000Jc3-3w; Sat, 16 Mar 2019 21:11:09 +0000 Received: from [127.0.0.1] (port=55113 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1h5GaC-00014R-9t; Sat, 16 Mar 2019 21:11:08 +0000 From: Andrew Gierth To: Morris de Oryx Cc: Rob Sargent , wim.bertels@ucll.be, Steve Haresnape , "pgsql-general\@postgresql.org" Subject: Re: Camel case identifiers and folding In-Reply-To: (Morris de Oryx's message of "Sat, 16 Mar 2019 10:30:39 +1100") Message-ID: <87bm2a6233.fsf@news-spur.riddles.org.uk> References: <1552641160.5846.2.camel@ucll.be> <7D62A9A2-C784-47A9-96BC-5949D0C8348E@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Sat, 16 Mar 2019 21:11:06 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "Morris" =3D=3D Morris de Oryx 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', '=C3=9F') or Greek (final sigma). Doi= ng 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). --=20 Andrew (irc:RhodiumToad)