Re: Floating point comparison inconsistencies of the geometric types

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: emre(at)hasegeli(dot)com
Cc: kgrittn(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us, andreas(at)proxel(dot)se, teodor(at)sigaev(dot)ru, robertmhaas(at)gmail(dot)com, kgrittn(at)ymail(dot)com, Jim(dot)Nasby(at)bluetreble(dot)com, mail(at)joeconway(dot)com
Subject: Re: Floating point comparison inconsistencies of the geometric types
Date: 2016-11-10 10:33:06
Message-ID: 20161110.193306.264948447.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

At Thu, 29 Sep 2016 10:37:30 +0200, Emre Hasegeli <emre(at)hasegeli(dot)com> wrote in <CAE2gYzxijWKwJ-ZPD--QHM+SxMd+vL_81_3Xt0spnCbsqFH=Ug(at)mail(dot)gmail(dot)com>
> > regression=# select 'I- 580 Ramp' < 'I- 580/I-680 Ramp';
> > ?column?
> > ----------
> > t
> > (1 row)
>
> on the Linux server I am testing, it is not:
>
> > regression=# select 'I- 580 Ramp' < 'I- 580/I-680 Ramp';
> > ?column?
> > ----------
> > f
> > (1 row)
>
> The later should be the case on your environment as the test was also
> failing for you. This is not consistent with the expected test
> result. Do you know how this test can still pass on the master?

Perhaps you ran the test under the environment LC_COLLATE (or
LANG) of something other than C. The reson for the result is
collation. The following returns expected result.

=# select 'I- 580 Ramp' < ('I- 580/I-680 Ramp' COLLATE "C");
?column?
----------
t
(1 row)

For a reason I don't know, say, en_US locale behaves in an
unintuitive way.

regression=# select ' ' < ('/' COLLATE "en_US"), ' x' < ('/a' COLLATE "en_US");
?column? | ?column?
----------+----------
t | f
(1 row)

Returning to the issue, the following query should give you the
expected result.

SELECT name, #thepath FROM iexit ORDER BY name COLLATE "C", 2;

regards,

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2016-11-10 11:54:12 Re: Is user_catalog_table sensible for matviews?
Previous Message Michael Paquier 2016-11-10 10:12:48 Re: Unlogged tables cleanup