Add note about CreateStatistics()'s selective use of check_rights.

Nathan Bossart <nathan@postgresql.org>

Commit: 29cf93b4b2a63273097c37f7dd0a0aed0f466798
Author: Nathan Bossart <nathan@postgresql.org>
Date: 2025-11-14T19:20:09Z
Releases: 18.2
Add note about CreateStatistics()'s selective use of check_rights.

Commit 5e4fcbe531 added a check_rights parameter to this function
for use by ALTER TABLE commands that re-create statistics objects.
However, we intentionally ignore check_rights when verifying
relation ownership because this function's lookup could return a
different answer than the caller's.  This commit adds a note to
this effect so that we remember it down the road.

Reviewed-by: Noah Misch <noah@leadboat.com>
Backpatch-through: 14

Files

PathChange+/−
src/backend/commands/statscmds.c modified +7 −1