On 27/07/2026 15:30, Andrey Borodin wrote:
Hi hackers!

At the sessions where I show newcomers around the codebase, we need a
first patch every time: small enough to finish in an hour, in a part of
the DBMSs everyone has an opinion about. The one we usually write makes
this work:

     FROM pg_stat_activity SELECT *;


I am generally in favor of this. (Notice: I haven't read the patch)


What I deliberately did not do: accept the section keywords in any order
at all (Vik's suggestion),


That wasn't really a serious suggestion.  Allegedly.


or allow SELECT last after GROUP BY (Andreas
Karlsson's). Both are defensible, but let's keep the surface minimal
and tied to the completion argument.


This is a lot more serious, and if we are going to move the SELECT clause, I agree with Andreas K. that it belongs after HAVING or possibly even later.


If the consensus is that our grammar should stay standard-only, that is
a perfectly good answer, and I will restore the punchline for the next
session.


The standard is never going to move the SELECT, so we are free to do so as an extension to the standard.  The main problem is it has become a mush-mash of random stuff so its proper placement is a bit vague.

--

Vik Fearing



Reply via email to