Re: Bug in either collation docs or code

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Bug in either collation docs or code
Дата
Msg-id CAKFQuwY0bT85sz4e2Bsnt69nJTLC2dQ0M-4npnHms0RXzW_e+A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Bug in either collation docs or code  (Melanie Plageman <melanieplageman@gmail.com>)
Ответы Re: Bug in either collation docs or code  (Melanie Plageman <melanieplageman@gmail.com>)
Список pgsql-hackers
On Fri, Jun 8, 2018 at 9:12 AM, Melanie Plageman <melanieplageman@gmail.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.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Melanie Plageman
Дата:
Сообщение: Re: Bug in either collation docs or code
Следующее
От: Melanie Plageman
Дата:
Сообщение: Re: Bug in either collation docs or code