CREATE INDEX: use the original userid for more ACL checks and fix for It in MPP.#1577
Open
reshke wants to merge 3 commits intoapache:mainfrom
Open
CREATE INDEX: use the original userid for more ACL checks and fix for It in MPP.#1577reshke wants to merge 3 commits intoapache:mainfrom
reshke wants to merge 3 commits intoapache:mainfrom
Conversation
Commit a117ceb used the original userid for ACL checks located directly in DefineIndex(), but it still adopted the table owner userid for more ACL checks than intended. That broke dump/reload of indexes that refer to an operator class, collation, or exclusion operator in a schema other than "public" or "pg_catalog". Back-patch to v10 (all supported versions), like the earlier commit. Nathan Bossart and Noah Misch Discussion: https://postgr.es/m/f8a4105f076544c180a87ef0c4822352@stmuk.bayern.de
x4m
approved these changes
Feb 15, 2026
x4m
approved these changes
Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR cherry-pick upstream commit ace9973867c and provides fix for it in MPP. The thing is, newly-added citext test runs OK it utility mode (QE-alone, without CDBDispatch logic involved). In MPP, test does not succeed, resulting in:
The reason is,
CdbDispatchUtilityStatementis called before restoring current user id, dispatches session and current user id, which in turn are used in QE to execute permission checking. See https://github.com/apache/cloudberry/blob/main/src/backend/cdb/dispatcher/cdbdisp_query.c#L921-L923 . So permission checks and executed against relation owner and not running (original) user (as intended by ace9973867c).Second commit in PR shuffles security context reset before CDB utility statement dispatch call.