Skip to content

PostgreSQL, Snowflake: Keep the signature in GRANT and REVOKE ON FUNCTION - #2727

Open
LucaCappelletti94 wants to merge 1 commit into
mainfrom
upstream/grant-function-signature
Open

LucaCappelletti94 wants to merge 1 commit into
mainfrom
upstream/grant-function-signature

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

GRANT and REVOKE ... ON FUNCTION and ON PROCEDURE kept the argument list as arg_types: Vec<DataType>, so an empty list and an absent one gave the same AST and GRANT EXECUTE ON FUNCTION f() TO bob printed back as GRANT EXECUTE ON FUNCTION f TO bob, which mean quite different things, as f() names the zero-argument overload, and a bare f is accepted only when no other function shares the name. Argument names and modes failed to parse, which breaks pg_dump output such as REVOKE ALL ON FUNCTION public.f(p_id uuid) FROM PUBLIC, and only one function was accepted per statement.

GrantObjects::Functions and GrantObjects::Procedures now hold Vec<FunctionDesc>, the type DROP FUNCTION and DROP PROCEDURE already use, and the parser reads them with the same parse_function_desc. They replace the Function and Procedure variants added for Snowflake in #1930, so this changes the public AST. Snowflake statements such as GRANT USAGE ON FUNCTION db1.sc1.foo(INT) TO ROLE role1 parse and print unchanged.

@codecov-commenter

codecov-commenter commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.32%. Comparing base (23e9e88) to head (4733038).

Files with missing lines Patch % Lines
src/parser/mod.rs 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2727      +/-   ##
==========================================
+ Coverage   82.30%   82.32%   +0.02%     
==========================================
  Files          42       42              
  Lines       35294    35263      -31     
  Branches    35294    35263      -31     
==========================================
- Hits        29047    29030      -17     
+ Misses       2690     2685       -5     
+ Partials     3557     3548       -9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LucaCappelletti94
LucaCappelletti94 force-pushed the upstream/grant-function-signature branch 3 times, most recently from e631f27 to df4db60 Compare October 26, 2026 21:03
@LucaCappelletti94
LucaCappelletti94 force-pushed the upstream/grant-function-signature branch from df4db60 to 4733038 Compare October 26, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants