cockroachdb / cockroachdb/cockroach

sql/parser: Support CURRENT_ROLE in RLS statements

Open
#137,124 0 comments 0 reactions 0 assignees View on GitHub
A-sql-privileges C-enhancement T-sql-foundations
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

When specifying roles in CREATE POLICY or ALTER POLICY, we aim to support the CURRENT_ROLE keyword as a synonym for CURRENT_USER. This enhancement will improve compatibility with PostgreSQL's row-level security (RLS) implementation.

The SQL grammar already includes CURRENT_ROLE:
https://github.com/cockroachdb/cockroach/blob/6acc26c2fdda017b76e9980d8c2adfc846c43e06/pkg/sql/parser/sql.y#L16055-L16060

The remaining task is to ensure CURRENT_ROLE is properly supported in the role specification list for CREATE POLICY and ALTER POLICY statements.

Epic CRDB-52152

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.