Insufficient description in collation mismatch error

From: Thom Brown <thom(at)linux(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Insufficient description in collation mismatch error
Date: 2011-04-19 23:14:30
Message-ID: BANLkTikomjBgXH=Xh9nf2emmmdRe+ekxiw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I tried applying a collation to a GROUP BY clause without applying the
collation to the corresponding column in the SELECT clause.

postgres=# SELECT things, count(*) FROM stuff GROUP BY things COLLATE "C";
ERROR: column "stuff.things" must appear in the GROUP BY clause or be
used in an aggregate function
LINE 1: SELECT things, count(*) FROM stuff GROUP BY things COLLATE "...

Firstly, does it even make sense for a GROUP BY clause to accept COLLATE?

Even if it does, this error message doesn't explain the problem, being
that the column with the necessary collation doesn't appear in the
SELECT.

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2011-04-19 23:29:08 Re: pgbench \for or similar loop
Previous Message Tom Lane 2011-04-19 23:03:27 Re: getting to beta