Re: insensitive collations

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Daniel Verite <daniel(at)manitou-mail(dot)org>, 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 21:29:20
Message-ID: CAH2-WznTeqBL=cX8_V2AaQFBoeiecMPcw__27oEXEb4J_vDuzw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 19, 2018 at 6:36 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I don't really find it "natural" for equality to consider obviously
> distinct values to be equal.

The Unicode consortium calls our current behavior within comparisons
"deterministic comparisons" -- it's something they're not so keen on:

https://unicode.org/reports/tr10/#Deterministic_Comparison

I suggest using their terminology for our current behavior. I can see
where Peter was coming from with "natural", but it doesn't quite work.
One problem with that terminology is that already refers to a sort
that sorts numbers as numbers. How about "linguistic", or "lexical"?

There is a significant cultural dimension to this. I suspect that you
don't find it "natural" that obviously distinct values compare as
equal because you're anglophone. That's the exact behavior you'll get
when using an unadorned en_US collation/locale, I think.

> 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.

FWIW, I don't think that your IEEE analogy quite works, because you're
talking about a property of a datatype. A collation is not intrinsic
to any collatable datatype. Fortunately, we're not required to agree
on what feels natural.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-12-19 21:41:48 Re: insensitive collations
Previous Message Andrew Dunstan 2018-12-19 20:55:51 Re: pg_dumpall --exclude-database option