From: jarek.stoklosa@gmail.com
To: pgsql-bugs@postgresql.org
Cc: jarek.stoklosa@gmail.com
Subject: BUG #14974: count doesn't accept text columns
Date: Thu, 14 Dec 2017 12:33:37 +0000
Message-ID: <20171214123337.29869.77621@wrigleys.postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 14974
Logged by: Jarosław Stokłosa
Email address: jarek.stoklosa@gmail.com
PostgreSQL version: 9.6.6
Operating system: Linux
Description:
create table test (t TEXT, tt TEXT);
insert into test values('a', 'b');
insert into test values('a', null::TEXT);
select t, count(tt) from test group by t;
Should be (a, 1) but I've got a error message:
column "test.tt" must appear in the GROUP BY clause or be used in an
aggregate function
select t, count(distinct tt) from test group by t;
gives "DISTINCT specified, but count is not an aggregate function"
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: jarek.stoklosa@gmail.com
Subject: Re: BUG #14974: count doesn't accept text columns
In-Reply-To: <20171214123337.29869.77621@wrigleys.postgresql.org>
References: <20171214123337.29869.77621@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