Skip to content

PostgreSQL: Parse schema-qualified calls to current_user and other role keywords - #2852

Open
LucaCappelletti94 wants to merge 3 commits into
mainfrom
upstream/qualified-role-keyword-calls
Open

LucaCappelletti94 wants to merge 3 commits into
mainfrom
upstream/qualified-role-keyword-calls

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

SELECT app.current_user() failed with Expected: end of statement, found: (, and so did the same call to session_user, user and current_catalog. This, of course, is a rather big issue when working with RLS in Postgres.

A word after a dot now always parses as a column, or as a function call when ( follows, without trying the keyword parsers. One side effect is that x.ARRAY(SELECT 1) no longer parses outside Snowflake, and PostgreSQL rejects it as well. Unqualified current_user() stays an error.

@LucaCappelletti94 LucaCappelletti94 added bug Something isn't working PostgreSQL labels Nov 7, 2026
@codecov-commenter

codecov-commenter commented Nov 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.53%. Comparing base (ccacedc) to head (7608c28).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2852      +/-   ##
==========================================
- Coverage   83.55%   83.53%   -0.02%     
==========================================
  Files          42       42              
  Lines       35692    35691       -1     
  Branches    35692    35691       -1     
==========================================
- Hits        29822    29816       -6     
- Misses       2429     2433       +4     
- Partials     3441     3442       +1     

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working PostgreSQL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants