awslabs / awslabs/amazon-redshift-utils

v_generate_user_grant_revoke_ddl creates invalid statement.

Open
#709 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.8k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

The output of the v_generate_user_grant_revoke_ddl creates invalid statement because it quotes the object.

ALTER DEFAULT PRIVILEGES for user testuser in schema testschema REVOKE ALL on "tables" FROM testone;
ALTER DEFAULT PRIVILEGES for user testuser in schema testschema1 REVOKE ALL on "procedures" FROM testone;
ALTER DEFAULT PRIVILEGES for user testuser in schema testschema1 REVOKE ALL on "functions" FROM testone;

The expected output should be objects (tables,procedures,functions) without quotes as below.

ALTER DEFAULT PRIVILEGES for user testuser in schema testschema REVOKE ALL on tables FROM testone;
ALTER DEFAULT PRIVILEGES for user testuser in schema testschema1 REVOKE ALL on procedures FROM testone;
ALTER DEFAULT PRIVILEGES for user testuser in schema testschema1 REVOKE ALL on functions FROM testone;

Contributor guide

Open the contributing guide

Research direction

Locate v_generate_user_grant_revoke_ddl and inspect how object names are inserted into generated ALTER DEFAULT PRIVILEGES statements. Reproduce the listed output, then verify generated statements use unquoted tables, procedures, and functions and remain valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.