cockroachdb / cockroachdb/cockroach
sql/parser: Support CURRENT_ROLE in RLS statements
Open
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
Assessment
This issue has not been assessed yet.