Re: Is this a bug?

From: Ian Harding <iharding(at)pakrat(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Is this a bug?
Date: 2001-02-28 03:38:33
Message-ID: 3A9C72B9.AFE5A145@pakrat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Limin Liu wrote:

> Hi,
>
> Can anyone please tell me whether this is a bug or not?
>
> I used the following SQL to create my table and view with some data.
>
> =======================
> create table tbl (no int, cnt int);
> create view tbl_view as
> select no, count(cnt) as count
> from tbl
> group by no
> having count(cnt) > 2;
> insert into tbl values(1, 1);
> insert into tbl values(1, 2);
> insert into tbl values(1, 3);
> insert into tbl values(1, 4);
> insert into tbl values(2, 1);
> insert into tbl values(2, 2);
> insert into tbl values(2, 3);
> =======================
>
> Here is soem SQL I issued; first one looks fine to me, but the second
> one is weird.
>
> =======================
> db=> select * from tbl_view;
> no | count
> ----+-------
> 1 | 4
> 2 | 3
> (2 rows)
>
> db=> select * from tbl_view where count > 5;
> no | count
> ----+-------
> 1 | 4
> 2 | 3
> (2 rows)
>
> db2=>
> =======================
>
> Thanx
>
> LM.Liu

I get ERROR: Rewrite: Aggregate of views only allowed on single tables
for now

I think it may have something to do with the reserved sql keyword
'count' being used.

Ian

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dominic J. Eidson 2001-02-28 03:50:43 BLCKSZ 0?
Previous Message Ian Harding 2001-02-28 03:29:22 Re: Re: vacuum and backup