Syntax
GRANT/REVOKE features:
- Table privileges: SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER
- Sequence privileges: USAGE, SELECT, UPDATE
- Function/Procedure privileges: EXECUTE (with function signature)
- Type/Domain privileges: USAGE
- WITH GRANT OPTION: Allow grantee to grant the same privileges to others
- REVOKE GRANT OPTION FOR: Revoke only the grant option while keeping the privilege
- PUBLIC: Special grantee representing all roles
Examples
Grant table privileges
Grant function privileges
Grant sequence privileges
Grant type privileges
Alter privileges
Revoke grant option
Canonical Format
When generating migration SQL, pgschema produces privileges in the following canonical format:- Always includes explicit
TABLEkeyword for table privileges - Privileges are sorted alphabetically (e.g.,
DELETE, INSERT, SELECT, UPDATE) - Function signatures include parameter names when available
- Each privilege change is a separate statement (no combining multiple roles)

