Check query

Started by PG Bug reporting form20 days ago5 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

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

Show quoted text

= 2;)

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: PG Bug reporting form (#1)
Re: Check query

On Friday, June 26, 2026, PG Doc comments form <noreply@postgresql.org>
wrote:

The following documentation comment has been logged on the website:

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

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

= 2;)

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

David J.

#3Fujii Masao
masao.fujii@gmail.com
In reply to: David G. Johnston (#2)
Re: Check query

On Sun, Jun 28, 2026 at 12:51 AM David G. Johnston
<david.g.johnston@gmail.com> wrote:

On Friday, June 26, 2026, PG Doc comments form <noreply@postgresql.org> wrote:

The following documentation comment has been logged on the website:

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

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

= 2;)

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

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

Attachments:

v1-0001-doc-Fix-typo-in-rule-system-view-example.patchapplication/octet-stream; name=v1-0001-doc-Fix-typo-in-rule-system-view-example.patchDownload+1-2
#4Daniel Gustafsson
daniel@yesql.se
In reply to: Fujii Masao (#3)
Re: Check query

On 7 Jul 2026, at 02:52, Fujii Masao <masao.fujii@gmail.com> 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.

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

--
Daniel Gustafsson

#5Fujii Masao
masao.fujii@gmail.com
In reply to: Daniel Gustafsson (#4)
Re: Check query

On Wed, Jul 8, 2026 at 12:01 AM Daniel Gustafsson <daniel@yesql.se> wrote:

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

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

Regards,

--
Fujii Masao