views containing aggregates

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: views containing aggregates
Date: 2000-08-27 03:31:16
Message-ID: 200008270331.e7R3VGB21463@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

NAGY Andras (nagya(at)inf(dot)elte(dot)hu) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
views containing aggregates

Long Description
Not sure, whether the `Views containing aggregates sometimes fail' and `Allow views of aggregate columns' entries from the TODO cover this, therefore the bug report. An aggregate select from a view containing aggregates behaves differently as expected. Even if the support for this is on TODO, until fixing this, postgres should print a warning or otherwise reject such use of views.

Sample Code
create table example (
name text
);
insert into example values('alpha');
insert into example values('alpha');
insert into example values('alpha');
insert into example values('alpha');
insert into example values('beta');
insert into example values('beta');
insert into example values('gamma');

-- the following should always return the number
-- of rows a simple `select * from relation' would return

select count(*) from example;
count
-------
7
(1 row)

create view example_view as select name from example group by name;
select * from example_view;
name
-------
alpha
beta
gamma
(3 rows)

-- however, it is not the case here

select count(*) from example_view;
count
-------
4
2
1
(3 rows)

No file was uploaded with this report

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2000-08-27 22:44:45 CREATE VIEW does not work from within plpgsql
Previous Message Gabor Z. Papp 2000-08-26 08:00:07 Error: unknown type 'ame'