GSets: Getting collation related error when GSets has text column

Поиск
Список
Период
Сортировка
От Jeevan Chalke
Тема GSets: Getting collation related error when GSets has text column
Дата
Msg-id CAM2+6=W=9=hQOipH0HAPbkun3Z3TFWij_EiHue0_6UX=oR=1kw@mail.gmail.com
обсуждение исходный текст
Ответы Re: GSets: Getting collation related error when GSets has text column  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Re: GSets: Getting collation related error when GSets has text column  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Hi,

When we have text column in the GROUPING SETS (and with some specific
order of columns), we are getting error saying
"could not determine which collation to use for string comparison"

Here is the example:

postgres=# select sum(ten) from onek group by rollup(four::text), two
order by 1;
ERROR:  could not determine which collation to use for string comparison
HINT:  Use the COLLATE clause to set the collation explicitly.

However if we have sql like;
select sum(ten) from onek group by two, rollup(four::text)
order by 1;

It is not failing.

After spending enough time, If I understood the code correctly, we are
re-ordering the sort columns but we are not remapping the grpColIdx
correctly.

Attached patch which attempts to fix this issue. However I am not sure
whether it is correct. But it does not add any new issues as such.
Added few test in the patch as well.

Please have a look.

Thanks

--
Jeevan B Chalke
Principal Software Engineer, Product Development
EnterpriseDB Corporation
The Enterprise PostgreSQL Company

Вложения

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [PATCH] Function to get size of asynchronous notification queue
Следующее
От: Fabien
Дата:
Сообщение: pgbench stats per script & other stuff