views containing aggregates

Поиск
Список
Период
Сортировка
От pgsql-bugs@postgresql.org
Тема views containing aggregates
Дата
Msg-id 200008270331.e7R3VGB21463@hub.org
обсуждение исходный текст
Список pgsql-bugs
NAGY Andras (nagya@inf.elte.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
theTODO cover this, therefore the bug report.  An aggregate select from a view containing aggregates behaves
differentlyas expected.  Even if the support for this is on TODO, until fixing this, postgres should print a warning or
otherwisereject 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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Gabor Z. Papp"
Дата:
Сообщение: Error: unknown type 'ame'
Следующее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: CREATE VIEW does not work from within plpgsql