Skip site navigation (1) Skip section navigation (2)

count(*) of zero rows returns 1

From: Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
To: PGSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: count(*) of zero rows returns 1
Date: 2013-01-13 21:12:18
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Can somebody explain why a standalone count(*) returns 1?

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

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

Gurjeet Singh


pgsql-hackers by date

Next:From: Tom LaneDate: 2013-01-13 21:16:10
Subject: Re: [PATCH] unified frontend support for pg_malloc et al and palloc/pfree mulation (was xlogreader-v4)
Previous:From: Tom LaneDate: 2013-01-13 21:09:29
Subject: Re: erroneous restore into pg_catalog schema

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group