Re: insensitive collations

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
Cc: "Peter Eisentraut" <peter(dot)eisentraut(at)2ndquadrant(dot)com>, "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: insensitive collations
Date: 2018-12-19 14:35:59
Message-ID: 9502.1545230159@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Daniel Verite" <daniel(at)manitou-mail(dot)org> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2018-12-19 14:53:18 Re: Some memory allocations in gin fastupdate code are a bit brain dead
Previous Message Chapman Flack 2018-12-19 14:17:24 Re: GraalVM