Re: "SELECT FROM foo" acts like "SELECT COUNT(*) FROM foo"?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: "SELECT FROM foo" acts like "SELECT COUNT(*) FROM foo"?
Date: 2023-02-01 20:06:56
Message-ID: CAKFQuwbOAfLm5zaZ03Fk8sQ2yU1jNX0RGQUeP9knGat+BHU=6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wednesday, February 1, 2023, Ron <ronljohnsonjr(at)gmail(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2023-02-01 20:10:21 Re: "SELECT FROM foo" acts like "SELECT COUNT(*) FROM foo"?
Previous Message Rodrigo Luna 2023-02-01 20:06:21 Re: "SELECT FROM foo" acts like "SELECT COUNT(*) FROM foo"?