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 1gZcxG-0000li-4O for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Dec 2018 14:36:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZcxE-0007We-Lt for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Dec 2018 14:36:08 +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 1gZcxE-0007RZ-9U for pgsql-hackers@lists.postgresql.org; Wed, 19 Dec 2018 14:36:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZcxB-0005YN-Ni for pgsql-hackers@postgresql.org; Wed, 19 Dec 2018 14:36:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id wBJEZx5v009503; Wed, 19 Dec 2018 09:35:59 -0500 From: Tom Lane To: "Daniel Verite" cc: "Peter Eisentraut" , "pgsql-hackers" Subject: Re: insensitive collations In-reply-to: <39af4787-8042-4891-887c-3283488735db@manitou-mail.org> References: <39af4787-8042-4891-887c-3283488735db@manitou-mail.org> Comments: In-reply-to "Daniel Verite" message dated "Wed, 19 Dec 2018 13:06:29 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9501.1545230159.1@sss.pgh.pa.us> Date: Wed, 19 Dec 2018 09:35:59 -0500 Message-ID: <9502.1545230159@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "Daniel Verite" writes: > To me it seems more natural to find a name for the other behavior, the > one that consists of overwriting the locale-sensitive equality with > the result of the byte-wise comparison. AFAIU the flag is meant > to say: "don't do that". > Some ideas that come to mind: > as an enum > CREATE COLLATION ... ( [EQUALITY = 'natural' | 'bytewise' ] ) > as a boolean > CREATE COLLATION ... ( [NATURAL_EQUALITY = true | false ] ) > defaulting to false > or > CREATE COLLATION ... ( [BYTEWISE_EQUALITY = true | false ] ) > defaulting to true I don't really find it "natural" for equality to consider obviously distinct values to be equal. As a counterexample, the fact that IEEE arithmetic treats 0 and -0 as equal seems to cause about as many problems as it solves, and newcomers to float math certainly don't find it "natural". So I object to that particular naming. Perhaps we could do something around "uniqueness"? That is, collations could have a boolean property UNIQUE, default true, or something like that. regards, tom lane