Re: Bug in either collation docs or code

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Bug in either collation docs or code
Date: 2018-06-08 16:20:27
Message-ID: CAKFQuwY0bT85sz4e2Bsnt69nJTLC2dQ0M-4npnHms0RXzW_e+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 8, 2018 at 9:12 AM, Melanie Plageman <melanieplageman(at)gmail(dot)com>
wrote:

> I tried inserting data and did not get an error:
>
> CREATE TABLE test1 (
> a text COLLATE "de_DE",
> b text COLLATE "es_ES"
> );
>
> INSERT INTO test1 VALUES('b','b'), ('c','c'), ('g','g'), ('h','h');
> SELECT a < (select 'foo' COLLATE "fr_FR") FROM test1;
>

​Suggest providing a self-contained script (set echo to all and capture the
output to a file), changing the table name to ensure no test pollution, and
including the version of the server in one of the queries.

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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2018-06-08 16:24:03 Re: Bug in either collation docs or code
Previous Message Melanie Plageman 2018-06-08 16:12:29 Re: Bug in either collation docs or code