Skip to content

Commit 5128b47

Browse files
craig[bot]rafiss
andcommitted
Merge #149633
149633: sql: use has_system_privilege instead of has_admin_role in logical_replication_spans view def r=rafiss a=rafiss This patch uses the recently added has_system_privilege to check a privilege rather then requiring the broadly scoped admin role. Epic: none Release note: None Co-authored-by: Rafi Shamim <[email protected]>
2 parents 90ae675 + eada954 commit 5128b47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/sql/crdb_internal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9182,7 +9182,7 @@ var crdbInternalLogicalReplicationResolvedView = virtualSchemaView{
91829182
SELECT
91839183
j.id AS job_id, jsonb_array_elements(crdb_internal.pb_to_json('progress', i.value)->'LogicalReplication'->'checkpoint'->'resolvedSpans') AS s
91849184
FROM system.jobs j LEFT JOIN system.job_info i ON j.id = i.job_id AND i.info_key = 'legacy_progress'
9185-
WHERE j.job_type = 'LOGICAL REPLICATION' AND pg_has_role(current_user, 'admin', 'member')
9185+
WHERE j.job_type = 'LOGICAL REPLICATION' AND has_system_privilege(current_user, 'REPLICATION')
91869186
) SELECT
91879187
job_id,
91889188
crdb_internal.pretty_key(decode(s->'span'->>'key', 'base64'), 0) AS start_key,

0 commit comments

Comments
 (0)