BUG #14974: count doesn't accept text columns - Mailing list pgsql-bugs

From jarek.stoklosa@gmail.com
Subject BUG #14974: count doesn't accept text columns
Date
Msg-id 20171214123337.29869.77621@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #14974: count doesn't accept text columns  (Marko Tiikkaja <marko@joh.to>)
List pgsql-bugs
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"



pgsql-bugs by date:

Previous
From: skaurus@gmail.com
Date:
Subject: BUG #14973: hung queries
Next
From: Marko Tiikkaja
Date:
Subject: Re: BUG #14974: count doesn't accept text columns