Order by with column ordinal and collate - fails to parse

Поиск
Список
Период
Сортировка
От Tim Kane
Тема Order by with column ordinal and collate - fails to parse
Дата
Msg-id CADVWZZJd5veDpEi_kgzBJ3uRNuE23Zs=x=az_PewssBfmA7TSA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Order by with column ordinal and collate - fails to parse
Список pgsql-general
Hi all,

I seem to be having problems constructing a query that combines the use of distinct, order by, and collate key words.

For instance:

# select distinct(value)  from properties order by 1 collate "C";
ERROR:  collations are not supported by type integer
LINE 1: ... distinct(value)  from properties order by 1 collate "C...
                                                             ^
# select distinct(value)  from properties order by distinct(value) collate "C";
ERROR:  syntax error at or near "distinct"
LINE 1: ...ct distinct(value)  from properties order by distinct(v...
                                                             ^
# select distinct(value) as foo from properties order by foo collate "C";
ERROR:  column "foo" does not exist
LINE 1: ...tinct(value) as foo from properties order by foo collat...


Am I just being a numpty here? I can work around it with a subquery, but this seems like a bug to me. Particularly the first example where my ordinal field reference is treated as an integer literal. I should note that the field 'value' is of type 'text' (not integer).

Any input appreciated. Thanks :)

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Exporting Data
Следующее
От: Alan Hodgson
Дата:
Сообщение: Re: Postgres DB crashing