List Grants and Privileges
pg_list_grantsList all privileges granted on tables, views, sequences, and functions in a PostgreSQL schema. Useful for security audits and understanding who has access to what.
Instructions
Show all privileges granted on tables, views, sequences, and functions in a schema.
Args:
schema: Schema name (default: public)
object_name: Filter to a specific object (optional)
grantee: Filter by role/user name (optional)
response_format: Output format
Returns: JSON: { grants: GrantInfo[], count: number } Markdown: table with grantor, grantee, object, privilege type, and grantable flag
Useful for security audits and understanding who has access to what.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | PostgreSQL schema name (default: public) | public |
| object_name | No | Filter to specific object (optional) | |
| grantee | No | Filter by grantee role name (optional) | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |