fix(cron): revoke TRIGGER on cron.job_run_details with CASCADE - #2399
Open
utkarash2991 wants to merge 1 commit into
Open
fix(cron): revoke TRIGGER on cron.job_run_details with CASCADE#2399utkarash2991 wants to merge 1 commit into
utkarash2991 wants to merge 1 commit into
Conversation
Follow-up to #2334. The grant on the cron tables is made WITH GRANT OPTION, so postgres may have re-granted TRIGGER on cron.job_run_details to another role. In that case a plain REVOKE fails with "dependent privileges exist", which breaks the one-time migration do-block (and the grant_pg_cron_access() re-run on a later CREATE EXTENSION). Switch the TRIGGER revoke to REVOKE ... CASCADE in the migration, grant_pg_cron_access() (migration + schema-{15,17,orioledb-17}), and pg_cron/after-create.sql. Add a pg_regress case that reproduces the delegated-grant state and asserts CASCADE clears TRIGGER from postgres and the delegated role.
PostgreSQL Extension Dependency Analysis: PR #2399
SummaryNo extensions had dependencies with MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Extension DependenciesPostgreSQL 17 Extension DependenciesOrioleDB 17 Extension Dependencies |
PostgreSQL Package Dependency Analysis: PR #2399
SummaryNo packages had MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Dependency ChangesExtracting PostgreSQL 15 dependencies...
Runtime Closure Size
Raw Dependency ClosurePostgreSQL 17 Dependency ChangesExtracting PostgreSQL 17 dependencies...
Runtime Closure Size
Raw Dependency Closure |
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.
Follow-up to #2334.
The grant on the cron tables is made
WITH GRANT OPTION, sopostgresmay have re-grantedTRIGGERoncron.job_run_detailsto another role. In that case a plainREVOKEfails with:which breaks the one-time migration
doblock (and thegrant_pg_cron_access()re-run on a laterCREATE EXTENSION).Adds a
pg_regresscase topg_cron_trigger_privilegesthat reproduces the delegated-grant state and assertsCASCADEclearsTRIGGERfrom bothpostgresand the delegated role (and that a plain revoke fails there).