Re: "SELECT FROM foo" acts like "SELECT COUNT(*) FROM foo"? - Mailing list pgsql-general

From David G. Johnston
Subject Re: "SELECT FROM foo" acts like "SELECT COUNT(*) FROM foo"?
Date
Msg-id CAKFQuwbOAfLm5zaZ03Fk8sQ2yU1jNX0RGQUeP9knGat+BHU=6A@mail.gmail.com
Whole thread Raw
In response to "SELECT FROM foo" acts like "SELECT COUNT(*) FROM foo"?  (Ron <ronljohnsonjr@gmail.com>)
List pgsql-general
On Wednesday, February 1, 2023, Ron <ronljohnsonjr@gmail.com> wrote:

test=# select  from sales_detail;
--
(11 rows)

It returned 11 rows as per the psql output text, if it acted like count(*), an aggregate, it would have only returned one row.

You have produced an 11-row, 0-column, output table.  It isn’t “supported” but is allowed for technical convenience, hence the decision to avoid trying to communicate this fact in the syntax diagram.

David J.

pgsql-general by date:

Previous
From: Rodrigo Luna
Date:
Subject: Re: "SELECT FROM foo" acts like "SELECT COUNT(*) FROM foo"?
Next
From: Tom Lane
Date:
Subject: Re: "SELECT FROM foo" acts like "SELECT COUNT(*) FROM foo"?