pg_manage_users
Create, drop, alter, and manage PostgreSQL user permissions, including granting or revoking access to databases, tables, and schemas. Simplify user administration and access control.
Instructions
Manage PostgreSQL users and permissions - create, drop, alter users, grant/revoke permissions. Examples: operation="create" with username="testuser", operation="grant" with username, permissions, target, targetType
Input Schema
Name | Required | Description | Default |
---|---|---|---|
cascade | No | Include CASCADE to drop owned objects (for drop/revoke operations) | |
connectionLimit | No | Maximum number of connections (for create/alter operations) | |
connectionString | No | PostgreSQL connection string (optional) | |
createdb | No | Allow user to create databases (for create/alter operations) | |
createrole | No | Allow user to create roles (for create/alter operations) | |
ifExists | No | Include IF EXISTS clause (for drop operation) | |
includeSystemRoles | No | Include system roles (for list operation) | |
inherit | No | Inherit privileges from parent roles (for create/alter operations) | |
login | No | Allow user to login (for create/alter operations) | |
operation | Yes | Operation: create (new user), drop (remove user), alter (modify user), grant (permissions), revoke (permissions), get_permissions (view permissions), list (all users) | |
password | No | Password for the user (for create operation) | |
permissions | No | Permissions to grant/revoke: ["SELECT", "INSERT", "UPDATE", "DELETE", "TRUNCATE", "REFERENCES", "TRIGGER", "ALL"] | |
replication | No | Allow replication privileges (for create/alter operations) | |
schema | No | Filter by schema (for get_permissions operation) | |
superuser | No | Grant superuser privileges (for create/alter operations) | |
target | No | Target object name (for grant/revoke operations) | |
targetType | No | Type of target object (for grant/revoke operations) | |
username | No | Username (required for create/drop/alter/grant/revoke/get_permissions, optional filter for list) | |
validUntil | No | Password expiration date YYYY-MM-DD (for create/alter operations) | |
withGrantOption | No | Allow user to grant these permissions to others (for grant operation) |