Repository navigation
Model who may execute a function - #142
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Oct 27, 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.
sql-traits filed every
GRANT ... ON FUNCTIONamong the table and column grants, and aREVOKEon a function left no trace because there was no recorded grant to subtract it from. A schema that revokesEXECUTEfromPUBLICon aSECURITY DEFINERfunction looked exactly like one that never did, and nothing could say who may call a function.PostgreSQL starts every function with
EXECUTEheld byPUBLICand by its owner, so a function's privileges have to begin at that default for a revoke to have something to take away. Each function now carries its own privileges, changed by the grants and revokes that reach it by signature, by a name only one function carries, or throughALL FUNCTIONS IN SCHEMA, andFunctionLikeanswersis_executable_by_public,can_executeandcan_grant_executefrom them. A grant on a function the schema never declares is refused under the closed world and reported byunresolved_access_referencesunder the open world, the same way a grant on an absent table is.This builds on apache/datafusion-sqlparser-rs#2727, which keeps the signature PostgreSQL writes in
GRANT ... ON FUNCTION, so the lockfile moves sqlparser to that commit.ALTER DEFAULT PRIVILEGESstill fails to parse until apache/datafusion-sqlparser-rs#2417 lands.