8000 feat: support `MAINTAIN` privilege in PG17 · barrownicholas/postgres-meta@2e30e9f · GitHub
[go: up one dir, main page]

Skip to content

Commit 2e30e9f

Browse files
committed
feat: support MAINTAIN privilege in PG17
1 parent 535a338 commit 2e30e9f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/lib/sql/table_privileges.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ where c.relkind in ('r', 'v', 'm', 'f', 'p')
6464
pg_has_role(c.relowner, 'USAGE')
6565
or has_table_privilege(
6666
c.oid,
67-
'SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER'
67+
'SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER, MAINTAIN'
6868
)
6969
or has_any_column_privilege(c.oid, 'SELECT, INSERT, UPDATE, REFERENCES')
7070
)

src/lib/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ export const postgresTablePrivilegesSchema = Type.Object({
506506
Type.Literal('TRUNCATE'),
507507
Type.Literal('REFERENCES'),
508508
Type.Literal('TRIGGER'),
509+
Type.Literal('MAINTAIN'),
509510
]),
510511
is_grantable: Type.Boolean(),
511512
})
@@ -525,6 +526,7 @@ export const postgresTablePrivilegesGrantSchema = Type.Object({
525526
Type.Literal('TRUNCATE'),
526527
Type.Literal('REFERENCES'),
527528
Type.Literal('TRIGGER'),
529+
Type.Literal('MAINTAIN'),
528530
]),
529531
is_grantable: Type.Optional(Type.Boolean()),
530532
})
@@ -542,6 +544,7 @@ export const postgresTablePrivilegesRevokeSchema = Type.Object({
542544
Type.Literal('TRUNCATE'),
543545
Type.Literal('REFERENCES'),
544546
Type.Literal('TRIGGER'),
547+
Type.Literal('MAINTAIN'),
545548
]),
546549
})
547550
export type PostgresTablePrivilegesRevoke = Static<typeof postgresTablePrivilegesRevokeSchema>

0 commit comments

Comments
 (0)
0