Re: Odd error when using UNION and COLLATE

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Odd error when using UNION and COLLATE
Дата
Msg-id CAKFQuwZSrzXhpnhox4fs7CyY2gnKsrx0hSxm6FmNMcQUNkTu5A@mail.gmail.com
обсуждение исходный текст
Ответ на Odd error when using UNION and COLLATE  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
On Wed, Jul 20, 2016 at 5:38 PM, Bruce Momjian <bruce@momjian.us> wrote:
I think the 'ORDER BY x COLLATE "C"' is being parsed as an a_expr, and
we don't allow a_expr in a UNION.  Perhaps we are too strict here, but I
can't tell.

​ORDER BY 1 COLLATE "C" is indeed an expression - the number no longer refers to a column position but it is a constant.  The presence or absence of UNION doesn't factor into things here - the expression itself is useless on its face.​

This one is a bit different in cause but I suspect is working as well as can be expected.

SELECT 'a-c' AS x UNION ALL SELECT 'ab' AS x ORDER BY x COLLATE "C";

​David J.​

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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Odd error when using UNION and COLLATE
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Odd error when using UNION and COLLATE