RE: count(*) from view??

From: "Sean Carmody" <sean(at)categoricalsolutions(dot)com(dot)au>
To: "Greg Brzezinski" <gregb(at)amg(dot)gda(dot)pl>, <pgsql-general(at)postgresql(dot)org>
Subject: RE: count(*) from view??
Date: 2000-09-11 21:45:20
Message-ID: 00af01c01c39$9578f620$0401a8c0@newton
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Some time ago, I also had similar problems involving sums and maxes within
a view. When I posted a query about the max problem, the response
was that "The rule rewriter has a lot of problems with views that involve
grouping
or aggregation --- until it's fixed, you need to be very wary of that
combination of features".

(Full reply at
http://www.postgresql.org/mhonarc/pgsql-bugs/1999-11/msg00009.html)

Now I'm not sure what the current state of development in that regard is,
but judging
from your experience, it looks like there's still a problem.

Not much help I'm sure, but there you go.

Sean.

> -----Original Message-----
> From: pgsql-general-owner(at)hub(dot)org [mailto:pgsql-general-owner(at)hub(dot)org]On
> Behalf Of Greg Brzezinski
> Sent: Friday, 8 September 2000 11:32 PM
> To: pgsql-general(at)postgresql(dot)org
> Subject: [GENERAL] count(*) from view??
>
>
> create table test (id int, user_name char(30));
> insert into test values (1, 'John');
> insert into test values (2, 'George');
>
> create view v_test as select * from test where user_name = 'John';
>
> select count(*) from v_test;
> count
> -------
> 2
> (1 row) Why?...Should returns 1
>
> select count(*) from test where user_name = 'John';
> count
> -------
> 1
> (1 row)
>
> --Greg--
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sean Carmody 2000-09-11 21:54:21 RE: count(*) from view??
Previous Message Peter Mount 2000-09-11 20:50:56 Re: port from MSSQLServer to PostgreSQL