Re: Select count(*) /*from*/ table - Mailing list pgsql-general

From Tom Lane
Subject Re: Select count(*) /*from*/ table
Date
Msg-id 19739.1309883157@sss.pgh.pa.us
Whole thread Raw
In response to Select count(*) /*from*/ table  (Alexander Shulgin <alex.shulgin@gmail.com>)
List pgsql-general
Alexander Shulgin <alex.shulgin@gmail.com> writes:
> I understand that there's really not much point in running COUNT w/o
> the FROM list, but maybe we should just disallow COUNT(*) with empty
> FROM list?

While I don't offhand see a use case for aggregates without FROM,
it's a long way from there to asserting that there is no use case.

The real foot-gun here IMO is the ability to omit "AS", which
unfortunately we're kind of stuck with because it's in the SQL standard.

            regards, tom lane

pgsql-general by date:

Previous
From: Geoffrey Myers
Date:
Subject: Re: out of memory error
Next
From: Alban Hertroys
Date:
Subject: Re: Read MS-SQL data into Postgres via ODBC link?