Re: count(*) from view??

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Brzezinski <gregb(at)amg(dot)gda(dot)pl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: count(*) from view??
Date: 2000-09-11 14:47:20
Message-ID: 13856.968683640@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greg Brzezinski <gregb(at)amg(dot)gda(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message K Parker 2000-09-11 15:00:10 Re: connecting via php
Previous Message The Hermit Hacker 2000-09-11 14:46:37 Re: problems with GRANT on Solaris 8