Re: insensitive collations - Mailing list pgsql-hackers

From Tom Lane
Subject Re: insensitive collations
Date
Msg-id 9502.1545230159@sss.pgh.pa.us
Whole thread Raw
In response to Re: insensitive collations  ("Daniel Verite" <daniel@manitou-mail.org>)
Responses Re: insensitive collations  (Peter Geoghegan <pg@bowt.ie>)
Re: insensitive collations  ("Daniel Verite" <daniel@manitou-mail.org>)
List pgsql-hackers
"Daniel Verite" <daniel@manitou-mail.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


pgsql-hackers by date:

Previous
From: Chapman Flack
Date:
Subject: Re: GraalVM
Next
From: David Rowley
Date:
Subject: Re: Some memory allocations in gin fastupdate code are a bit brain dead