From: tim.kane@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #8243: Order by with column ordinal and collate - fails to parse
Date: Thu, 20 Jun 2013 15:08:25 +0000
Message-ID: <E1UpgTJ-0007Di-Qu@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 8243
Logged by: Tim Kane
Email address: tim.kane@gmail.com
PostgreSQL version: 9.1.9
Operating system: Debian
Description:
As per psql general mailing list thread:
http://www.postgresql.org/message-id/CADVWZZJd5veDpEi_kgzBJ3uRNuE23Zs=x=az_PewssBfmA7TSA@mail.gmail....
The following query refuses to parse:
# 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...
The solution was as follows:
# select distinct(value) collate "C" from properties order by 1;
It's arguable if this is a bug or not, though I would have expected the
first attempt at least to be valid.
Cheers,
Tim
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tim.kane@gmail.com
Subject: Re: BUG #8243: Order by with column ordinal and collate - fails to parse
In-Reply-To: <E1UpgTJ-0007Di-Qu@wrigleys.postgresql.org>
References: <E1UpgTJ-0007Di-Qu@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox