count(*) of zero rows returns 1 - Mailing list pgsql-hackers

From Gurjeet Singh
Subject count(*) of zero rows returns 1
Date
Msg-id CABwTF4WOpQi53+rSoHOrP1j0LpbQ7vtyF2mvOP__cZwmas4Scw@mail.gmail.com
Whole thread
Responses Re: count(*) of zero rows returns 1
List pgsql-hackers
Can somebody explain why a standalone count(*) returns 1?

postgres=# select count(*);
 count
-------
     1
(1 row)

I agree it's an odd thing for someone to query, but I feel it should return 0, and not 1.

--

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: erroneous restore into pg_catalog schema
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] unified frontend support for pg_malloc et al and palloc/pfree mulation (was xlogreader-v4)