Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wDzBI-003YG9-1F for pgsql-docs@arkaria.postgresql.org; Sat, 18 Apr 2026 06:29:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wDzBH-00CIDg-1L for pgsql-docs@arkaria.postgresql.org; Sat, 18 Apr 2026 06:29:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wDzBH-00CIDY-0M for pgsql-docs@lists.postgresql.org; Sat, 18 Apr 2026 06:29:27 +0000 Received: from mail-yw1-x112c.google.com ([2607:f8b0:4864:20::112c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wDzBE-00000001m4K-2dZQ for pgsql-docs@lists.postgresql.org; Sat, 18 Apr 2026 06:29:26 +0000 Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-79db5e18ac6so26007707b3.1 for ; Fri, 17 Apr 2026 23:29:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776493761; cv=none; d=google.com; s=arc-20240605; b=jc57rVE9/rBYP8SqEGoO7aXpxQpS+52SScyn+uI3vXVeEasxI9sW7iXL+Xm7yIH5wb 6rVK6VvK3+cRuXP9XlCK6i9SGOyw2R2ko0Flugq7zaEmRXORcj2331pL4HYpn8vM+z8T gVFG2xbVNcAOBBERxUXmyl1848wXk/3pm4mGsRYBRKvvUl1hGBw6V2DiCCaSHzUi5fZP 9oAVhKw4afxHkjMkTdzFNydRXnLhG33OjSma+vMYIh/d5WsImODEghQfxMvqhgsxxLfx n9F/Nas3RytsEkVVn7z0pMm1M9hYecqt0lelGRYF2ujE3VzX9ByH7Mv4mD5ayG0qaD8Y QURw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :dkim-signature; bh=ObYWF3qwbeybRz3osBOXqk1GHAcgIg+AD8ZvdOnxXbg=; fh=r4gCM7GDxMRj3P0KIxiF6t0c05XoY9KIDKg5IXozD6s=; b=LAGBkyNBnvHjIUl0VQmAg66Xbjax9IChqI1JEhrV0Zn23txvYtxAIy4FU3WacbAWGY EFDEK4OaxL+0XtYa1N+/JVQkDxgKiRtxc7O5firdbkNkFCtudJ0kIToUS3+lCkyj/2M1 xfGxwIb8jz8Gh+MVXoULAi/8UCNzECp2TBKVw/cdg9UCfNkpy1xL5yCDIhSRF8wo8dJd LpxV8RA6UQ0cMQEXuLvxt6na5bYPvSqPjKeZQvyJJgQ7YcTOTYRgAYJswguGzeb8X3Hz zdIa9E07XwUKV1y1G0/QnjFsfsdK5SIbBafkOy1yBZVbm38BABe89RNeClTTscbDhzdp I3bg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776493761; x=1777098561; darn=lists.postgresql.org; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=ObYWF3qwbeybRz3osBOXqk1GHAcgIg+AD8ZvdOnxXbg=; b=THGl5bPgj5n52IKDRSBN4TTz2HPt+/E0utHql5RIc8JgMCjWOq7qj3DlCZEwLIWieM Jc1vW1N9sNZBThGI9CbkpBRbz/VJhJbBjebW7FtHV3fCdfSKR372Dhl2VkiKXiTewpH/ 15IZ6L2hm+Uk7UjMgFeu+rl5u7cMvXyEBB9h6yr98HJSsESRO6rD1FLCiJS3XIkno7gL 9vDr0Xc9xbziIEqjjEm1N7m0hututMjpIn/IvBjNIJYiow+IeEh8mo+b/GsBHTTse3bT sKfdmcBGSCJnxZGrSKT+8hGmzcdTnFR/AVmOrSrEiAt5B/sQgbeLhux/9mWfT89ihRJ3 Jn8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776493761; x=1777098561; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ObYWF3qwbeybRz3osBOXqk1GHAcgIg+AD8ZvdOnxXbg=; b=Rhnd1JyhtZmG0zbrh4xqjhPXqeJAh6nPYGRcUukcayaY3aHkD59s+ZyJ3KBEjjSUEy vZswM9lFukxJrMnTw1B5zh3ZWp2V2JJRK46JG9IQODtWUVS7krANwgpYXGmFifYnSS94 fZ73SLRR+EMGRfqbAlhE+u3+uLJ1nbJ0tZb2IGbsNb7cpPqAnIbIoRgc9FaR0UopplOj 3YP4y9lbmqsl0WkrNp0CLPRju7O8HF9yRkoY0RvyOuEZD836u5Mnv6QeO+QrFyxvrTYC ZL+aZbpGkB24NFSe95jl4JtklbEgNQFzhpAbBFmmNtrw78XfWZfMeLh+X4AYsqt0oP0d 4RxQ== X-Forwarded-Encrypted: i=1; AFNElJ9nWYW9AweDau5WCS8aGTR6+JmjgFe9GQ3TlpZMpHiSTEITRmG+1Xras4jgjD7zt2dRtvDfy3aV8VK/@lists.postgresql.org X-Gm-Message-State: AOJu0YxOD2ZmAfBNpxsoXvpObqnYOkozjS7Rixlnwz5p4RQXpD+3ux5Z 2yPlDSMsY5VQ22+oIDmWdqB5W+He+uV4sRPZxnZPN6xCGIzAUIQKU/DgSl4JuBqiZf/cMO3Dkhu JLz+lSwoUjJOT5289IUoMWcFtAiZNpBg= X-Gm-Gg: AeBDievHq74cH/O6L5UUwskDnd4DiBm++cEYF2iMYWM1q9sxRD1Os21uIeIgXV+x+kw Zxtl34G+VRTqyXJ47w1xBorX/thJSwniONSS3q8a43xBngTDpFYKUsO0dtx6mfDJYXpAkQKKMwB 0KBqW0btQ4Ygm5fKBEO7cliSFbW35PfmdrhWCpOQ5yc1hCuWOtBc/5yArveQumQXb6LXdpCqH6j yu6Vo9rRO4GHPtFH5QHHqaqjJbbgeBL2+1P43uC1Zm3HhzX4/UAaA5gAKItmRL30QBSAqBF7OhG fXxdg27uZKRyMm9kTTGsYPz+gbOP X-Received: by 2002:a05:690e:1406:b0:651:c221:9648 with SMTP id 956f58d0204a3-653118d26a6mr3933801d50.10.1776493761267; Fri, 17 Apr 2026 23:29:21 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:7011:1496:b0:514:cdda:a303 with HTTP; Fri, 17 Apr 2026 23:29:20 -0700 (PDT) In-Reply-To: <177634636825.403056.10912625029192163239@wrigleys.postgresql.org> References: <177634636825.403056.10912625029192163239@wrigleys.postgresql.org> From: "David G. Johnston" Date: Fri, 17 Apr 2026 23:29:20 -0700 X-Gm-Features: AQROBzC519a4TeWcU7wiooQ5uJZ00TmGu5-3H_B8GNOCOnCCZWBgdLRW2Hie64c Message-ID: Subject: Re: Unclear documentation and requirement of clarification To: "aravinat2001@gmail.com" , "pgsql-docs@lists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000960ba1064fb62f14" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000960ba1064fb62f14 Content-Type: text/plain; charset="UTF-8" On Thursday, April 16, 2026, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/18/tutorial-agg.html > Description: > > (This restriction exists because the WHERE clause determines which > rows will be included in the aggregate calculation; so obviously it has to > be evaluated before aggregate functions are computed.) > > This would be better off if it's mentioned that in this particular case, we > actually need the aggregate function to be computed before the WHERE clause > and that's why we are using a subquery. > > That is what the parenthetical says, though without introducing the term subquery. Without a question or a concrete proposed alternative leaving this as-is seems reasonable. I have no qualms with it at least. David J. --000000000000960ba1064fb62f14 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thursday, April 16, 2026, PG Doc comments form <noreply@postgresql.org> wrote:
The following documentation comment has been logged on th= e website:

Page: https://www.postgresql.org/docs/18/tutorial-agg.html=
Description:

(This restriction exists because the WHERE clause determines which
rows will be included in the aggregate calculation; so obviously it has to<= br> be evaluated before aggregate functions are computed.)

This would be better off if it's mentioned that in this particular case= , we
actually need the aggregate function to be computed before the WHERE clause=
and that's why we are using a subquery.


That is what the parenthetical says, thoug= h without introducing the term subquery.

Without a= question or a concrete proposed alternative leaving this as-is seems reaso= nable.=C2=A0 I have no qualms with it at least.

Da= vid J.

--000000000000960ba1064fb62f14--