Skip to content

Commit b45024d

Browse files
authored
Add exclusion for pg_automv schema (#91)
1 parent 5dbe8b9 commit b45024d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SecretsManagerRedshiftRotationMultiUser/lambda_function.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def set_secret(service_client, arn, token):
222222
table_perm_types = ['SELECT', 'INSERT', 'UPDATE', 'DELETE', 'REFERENCES']
223223
for perm in table_perm_types:
224224
cur.execute("SELECT QUOTE_IDENT(tab.schemaname) as schemaname, QUOTE_IDENT(tab.tablename) as tablename FROM pg_tables tab WHERE "
225-
"HAS_TABLE_PRIVILEGE(%s, QUOTE_IDENT(tab.schemaname) + '.' + QUOTE_IDENT(tab.tablename) , %s) AND tab.schemaname NOT IN ('pg_internal')",
225+
"HAS_TABLE_PRIVILEGE(%s, QUOTE_IDENT(tab.schemaname) + '.' + QUOTE_IDENT(tab.tablename) , %s) AND tab.schemaname NOT IN ('pg_internal','pg_automv')",
226226
(current_dict['username'], perm))
227227
tables = [row.schemaname + '.' + row.tablename for row in cur.fetchall()]
228228
if tables:

0 commit comments

Comments
 (0)