discovery=> select count(*) from publications;
count
-----
    0
(1 row)

  Does 1 rows is a correct result ?

	Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83


Mon, 31 May 1999 11:41:49 +0400 (MSD)
Oleg Bartunov <oleg@sai.msu.su>
select count(*) from <empty table>: 0 rows or 1 rows ?
Thus spake Oleg Bartunov
> discovery=> select count(*) from publications;
> count
> -----
>     0
> (1 row)
> 
>   Does 1 rows is a correct result ?

Absolutely.  "SELECT COUNT(*)..." always returns exactly one row (well,
assuming that the table exists, of course) so this is correct.  A return
of zero rows would imply that no information was returned but you did
get back information here, the fact that the table is empty.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.

Mon, 31 May 1999 08:29:55 -0400 (EDT)
"D'Arcy" "J.M." Cain <darcy@druid.net>
Re: [HACKERS] select count(*) from <empty table>: 0 rows or 1 rows ?
> discovery=> select count(*) from publications;
> count
> -----
>     0
> (1 row)
> 
>   Does 1 rows is a correct result ?
> 
> 	Oleg

One row is returned, and that row is zero.  It is correct.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Mon, 31 May 1999 12:11:22 -0400 (EDT)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: [HACKERS] select count(*) from <empty table>: 0 rows or 1 rows ?