Re: count(*) from view?? - Mailing list pgsql-general

From Tom Lane
Subject Re: count(*) from view??
Date
Msg-id 13856.968683640@sss.pgh.pa.us
Whole thread Raw
In response to count(*) from view??  (Greg Brzezinski <gregb@amg.gda.pl>)
List pgsql-general
Greg Brzezinski <gregb@amg.gda.pl> writes:
> 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

Yup, it should, and 1 is indeed what I get.  How old a version of
Postgres are you using?  I think there used to be bugs like this
a few versions back...

            regards, tom lane

pgsql-general by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: problems with GRANT on Solaris 8
Next
From: "K Parker"
Date:
Subject: Re: connecting via php