Re: Bug in either collation docs or code - Mailing list pgsql-hackers

From Melanie Plageman
Subject Re: Bug in either collation docs or code
Date
Msg-id CAAKRu_awoyXhb9UF2HiLDpe0J-jYThaEyZoVb8=aQdR2ZYBjwg@mail.gmail.com
Whole thread Raw
In response to Re: Bug in either collation docs or code  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Bug in either collation docs or code
List pgsql-hackers


I did my test on 9.6.5 ​(Ubuntu 16.04) with:

CREATE TABLE test_col (
    a text COLLATE "en_CA.utf8",
    b text COLLATE "en_US.utf8"
);
INSERT INTO test_col VALUES ('A', 'A');
SELECT a < (SELECT 'foo'::text COLLATE "en_GB.utf8") FROM test_col;

SQL Error: ERROR:  could not determine which collation to use for string comparison
HINT:  Use the COLLATE clause to set the collation explicitly.

Note, I had to include the cast to text in order for the query to execute...

David J.


On postgres built off of master on my mac (sierra), the following is the output:

DROP TABLE IF EXISTS test_col_mac;
DROP TABLE
CREATE TABLE test_col_mac (
    a text COLLATE "de_DE",
    b text COLLATE "es_ES"
);
CREATE TABLE
INSERT INTO test_col_mac VALUES('A','A');
INSERT 0 1
SELECT a < (SELECT 'foo'::TEXT COLLATE "fr_FR") FROM test_col_mac;
 ?column?
----------
 t
(1 row)


--
Melanie Plageman

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Needless additional partition check in INSERT?
Next
From: Alvaro Herrera
Date:
Subject: Re: Needless additional partition check in INSERT?