Authorizing select count()

From: Laetitia Avrot <laetitia(dot)avrot(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Authorizing select count()
Date: 2022-05-25 10:26:47
Message-ID: CAB_COdjwCJWP35B=z0M4fz=1vGUax1OZpMbpwuhw94gJZw7aDg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

Vik Fearing pointed out the inconsistency in the SQL Standard that imposes
using count(*) (with a star) but row)number() without it.

Vik's point of view is that we should be able to use row_number with a
star, which is already implemented in Postgres.

My point of view is we could add support for count(). It does not remove
the compliance with the SQL Standard, it just adds an extra feature.

You will find enclosed a patch proposal to allow count to be used without a
star. I, on purpose, decided not to document this behavior, maybe that's
wrong.

Have a great day,

Lætitia

Attachment Content-Type Size
ability_to_use_count_without_star_v1.patch application/octet-stream 2.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthias van de Meent 2022-05-25 10:54:46 Re: adding status for COPY progress report
Previous Message Tomas Vondra 2022-05-25 10:13:45 Re: Improving connection scalability (src/backend/storage/ipc/procarray.c)