Subject: Check query

From: PG Doc comments form <[email-masked]>
Date: Fri, 26 Jun 2026 14:37:56 +0000

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/18/rules-views.html
Description:

Please check that the condition in the query is correct.

> 39.2.1. How SELECT Rules Work

Similarly, the rules for shoe and shoelace are substituted into the range
table of the subquery, leading to a three-level final query tree:

SELECT shoe_ready.shoename, shoe_ready.sh_avail,
       shoe_ready.sl_name, shoe_ready.sl_avail,
       shoe_ready.total_avail
...
...
WHERE shoe_ready.total_avail > 2;  ??? (maybe WHERE shoe_ready.total_avail
>= 2;)

---

From: "David G. Johnston" <[email-masked]>
Date: Sat, 27 Jun 2026 08:51:09 -0700

> WHERE shoe_ready.total_avail > 2;  ??? (maybe WHERE shoe_ready.total_avail

Yes, the lack of an equal sign there is a typo.

David J.

---

From: Fujii Masao <[email-masked]>
Date: Tue, 7 Jul 2026 09:52:39 +0900

On Sun, Jun 28, 2026 at 12:51 AM David G. Johnston
<[email-masked]> wrote:
>
> On Friday, June 26, 2026, PG Doc comments form <[email-masked]> wrote:
>>

Yes. Very old commit dcb00495236 seems to have accidentally changed
the condition to > 2 while rewriting the example to use SQL operator
notation.

The attached patch changes it from > 2 to >= 2.
Barring any objections, I'll backpatch it to all supported branches.

Regards,

-- 
Fujii Masao

---

From: Daniel Gustafsson <[email-masked]>
Date: Tue, 7 Jul 2026 17:00:46 +0200

> On 7 Jul 2026, at 02:52, Fujii Masao <[email-masked]> wrote:

> Barring any objections, I'll backpatch it to all supported branches.

LGTM.  I reviewed the referenced commit to see if there were other similar
mistakes but found none.

--
Daniel Gustafsson

---

From: Fujii Masao <[email-masked]>
Date: Wed, 8 Jul 2026 09:08:43 +0900

> LGTM.  I reviewed the referenced commit to see if there were other similar

Thanks for the review and check! I've pushed the patch.

Regards,

-- 
Fujii Masao