Show table privileges
pg_table_privilegesAudit table access by listing which roles hold SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, or TRIGGER privileges on a table or all tables in a schema. Omit the table to review schema-wide grants before a migration.
Instructions
Show which roles have which privileges (SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER) on a table or on every table in a schema. If table is omitted, the result spans every table in schema, ordered by table then grantee. Use this to answer 'who can write to this table?' or to audit schema-wide access before a migration. Visibility caveat: backed by information_schema.table_privileges, which postgres filters by what the calling role can see. A least-privileged role may not see grants involving unrelated third-party roles. For a complete picture, run as a superuser or a member of pg_read_all_data.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "pg_table_privileges"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | No | Table name. Omit to list privileges for all tables in the schema. | |
| schema | No | Schema name (defaults to 'public'). | public |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes |