select count(*); - Mailing list pgsql-general

From Marc Mamin
Subject select count(*);
Date
Msg-id B6F6FD62F2624C4C9916AC0175D56D8828BE7FB3@jenmbs01.ad.intershop.net
Whole thread Raw
Responses Re: select count(*);
List pgsql-general
Hello,


select *;
----------
ERROR:  SELECT * with no tables specified is not valid

select count(*);
----------------
1

Is this a must? and why 1?

It may lead to uncatched issues by typos. e.g.:

select count(*) FROMpg_stat_activity;

FROMpg_stat_activity
---------------------
1

regards,

Marc Mamin


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Prevent roles not having admin option from granting themselves to other roles
Next
From: Chris Mair
Date:
Subject: Re: select count(*);