Re: [GENERAL] Select count(*) /*from*/ table

2011-07-05 Thread Tom Lane
Alexander Shulgin 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

[GENERAL] Select count(*) /*from*/ table

2011-07-05 Thread Alexander Shulgin
Hello, Today I've mistyped a SELECT (effectively omitting the FROM clause): $ SELECT COUNT(*) my_table; my_table -- 1 (1 row) Apparently, my_table was treated as an alias to the COUNT(*) expression. This has been discussed before, e.g. here: http://archives.postgresql.org/pgsql