select count(*);

From: Marc Mamin <M(dot)Mamin(at)intershop(dot)de>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: select count(*);
Date: 2015-06-11 13:46:10
Message-ID: B6F6FD62F2624C4C9916AC0175D56D8828BE7FB3@jenmbs01.ad.intershop.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Mair 2015-06-11 13:56:24 Re: select count(*);
Previous Message Adrian Klaver 2015-06-11 13:07:10 Re: Prevent roles not having admin option from granting themselves to other roles