Repository navigation
Conversation
When updating an existing role, the `DatabaseRole` reconciler granted and revoked its memberships before running `ALTER ROLE`. From PostgreSQL 16 a membership granted without an `inherit` option takes it from the `inherit` attribute the role has at that moment, so a membership added in the same change that turned the attribute off was granted with `inherit_option` set, and the role kept inheriting the privileges of that role. Memberships are now applied after the attributes and the comment. Closes #11824 Signed-off-by: Armando Ruocco <[email protected]>
Contributor
|
❗ By default, the pull request is configured to backport to all release branches.
|
Member
Author
|
/test |
Contributor
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/41474699515 |
Member
Author
|
/test |
Contributor
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/41623364911 |
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.
When updating an existing role, the
DatabaseRolereconciler granted and revoked its memberships before runningALTER ROLE. From PostgreSQL 16 a membership granted without anINHERIToption takes it from theinheritattribute the role has at that moment, so a membership added in the same change that turned the attribute off was granted withinherit_optionset, and the role inherited the privileges of that role although it wasNOINHERIT.The memberships are now applied after the attributes and the comment. The e2e test "applies the updated attributes in PostgreSQL" now sets
inherit: falseandinRoles: [pg_monitor]in the same patch and, from PostgreSQL 16, checks theinherit_optionof the new membership: on kind with PostgreSQL 18.6 it iston main andfwith this change.Closes #11824