Re: Order by with column ordinal and collate - fails to parse

From: Tim Kane <tim(dot)kane(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Order by with column ordinal and collate - fails to parse
Date: 2013-06-20 15:02:31
Message-ID: CADVWZZK_HT65xtHuzN677GPy_0FF5i_EnGtJ6xPvjJYUOthOcQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Nice one. Yep, that works. Cheers..
I'll submit a bug report for this, though I'm on the fence as to wether
this is actually a bug per se.. I would have reasonably expected my
original syntax to have worked (as it does without any ORDER BY)..

On Thu, Jun 20, 2013 at 3:44 PM, Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>wrote:

> On 06/20/2013 07:05 AM, Tim Kane wrote:
>
>> 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...
>> ^
>>
>
> How about:
>
> select distinct(value) collate "C" from properties order by 1 ;
>
>
>
>> 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 :)
>>
>>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)gmail(dot)com
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dmitriy Igrishin 2013-06-20 15:08:35 Frontend/backend protocol improvements proposal (request).
Previous Message Adrian Klaver 2013-06-20 14:44:17 Re: Order by with column ordinal and collate - fails to parse