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
Works just fine here.
select t, count(distinct tt) from test group by t; gives "DISTINCT specified, but count is not an aggregate function"
Are you sure you don't have a poorly-named "count" function defined? What's the output of: