Return ALTER DEFAULT PRIVILEGES entries (pg_default_acl): what grants the NEXT object of each type will get, per granting role and per schema.
read-onlyany connectionsweeps instancesweeps group
defaultPrivileges([schema])
Return ALTER DEFAULT PRIVILEGES entries (pg_default_acl): what grants the NEXT object of each type will get, per granting role and per schema. checkRoleAccess answers about the objects that exist; this is the only thing that answers about the ones that do not yet, and it is the standing cause of "the new table is not readable and every old one is" -- which presents as a broken grant and is a missing default. scope 'global' (defaclnamespace = 0) overrides the hard-wired defaults for that object type; scope 'schema' entries are ADDED to the global ones, so two entries for one type are cumulative rather than conflicting.
Note that defaults apply only to objects created by the granting role, which is why granted_by is reported beside every entry.
Also accepts connection, instance, group, described once under arguments every tool takes.
Default privileges: what grants the NEXT object gets. An absent extension or a missing grant is reported as {error, hint} instead.
| Field | Type |
|---|---|
| default_privileges | array | null |
A physical replica is byte-identical here, so asking each member of a replication group adds nothing.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "defaultPrivileges",
"arguments": {
"schema": "shop"
}
}
}
{
"default_privileges": [
{
"scope": "global",
"schema": null,
"granted_by": "migrator",
"object_type": "function",
"grants": {
"PUBLIC": [
"EXECUTE"
]
}
},
{
"scope": "schema",
"schema": "shop",
"granted_by": "migrator",
"object_type": "table",
"grants": {
"reporting": [
"SELECT"
]
}
}
]
}
Invented values on a fictional shop database, shaped by and checked against this tool's output schema. Real output is returned as structuredContent to clients that negotiate MCP 2025-06-18 or later.