Skip to content

Commit

Permalink
feat: support MAINTAIN privilege in PG17
Browse files Browse the repository at this point in the history
  • Loading branch information
soedirgo committed Dec 4, 2024
1 parent 535a338 commit 71efa94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/sql/table_privileges.sql
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ where c.relkind in ('r', 'v', 'm', 'f', 'p')
pg_has_role(c.relowner, 'USAGE')
or has_table_privilege(
c.oid,
'SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER'
'SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER, MAINTAIN'
)
or has_any_column_privilege(c.oid, 'SELECT, INSERT, UPDATE, REFERENCES')
)
Expand Down
3 changes: 3 additions & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ export const postgresTablePrivilegesSchema = Type.Object({
Type.Literal('TRUNCATE'),
Type.Literal('REFERENCES'),
Type.Literal('TRIGGER'),
Type.Literal('MAINTAIN'),
]),
is_grantable: Type.Boolean(),
})
Expand All @@ -525,6 +526,7 @@ export const postgresTablePrivilegesGrantSchema = Type.Object({
Type.Literal('TRUNCATE'),
Type.Literal('REFERENCES'),
Type.Literal('TRIGGER'),
Type.Literal('MAINTAIN'),
]),
is_grantable: Type.Optional(Type.Boolean()),
})
Expand All @@ -542,6 +544,7 @@ export const postgresTablePrivilegesRevokeSchema = Type.Object({
Type.Literal('TRUNCATE'),
Type.Literal('REFERENCES'),
Type.Literal('TRIGGER'),
Type.Literal('MAINTAIN'),
]),
})
export type PostgresTablePrivilegesRevoke = Static<typeof postgresTablePrivilegesRevokeSchema>
Expand Down

0 comments on commit 71efa94

Please sign in to comment.