CLIOperatorPlan before apply

Treat PostgreSQL access like a control plane, not a pile of grants.

Define roles, memberships, schema profiles, and default privileges once. Review the exact SQL plan, then let pgroles converge the database and keep drift visible.

Convergent model
Manifest is truth
Preview path
CLI diff + operator plan
Runtime
CI, OTLP, Kubernetes

Desired state

Policy manifest
profiles:
  writer:
    grants:
      - privileges: [USAGE]
        object: { type: schema }
      - privileges: [SELECT, INSERT, UPDATE, DELETE, TRIGGER]
        object: { type: table, name: "*" }
      - privileges: [USAGE, SELECT, UPDATE]
        object: { type: sequence, name: "*" }

Change plan

Diff summary
Plan: 4 change(s)
  1 role(s) to create
  2 grant(s) to add
  1 default privilege(s) to set

Control plane

Operator status
status:
  conditions:
    - type: Ready
      status: "True"
      reason: Planned
    - type: Drifted
      status: "True"

Choose your path

On this page

Try pgroles

Start here
Install pgroles and run your first diff against a live database.
Open guide
Guide
Install the Kubernetes operator, review a first plan, and verify the result.
Open guide

Bring an existing database under management

Start with staged adoption and check executor prerequisites. Additive mode lets you introduce declared access before deciding which undeclared access to remove.

Review a policy or plan

Guide
Validate a policy, compare it with a snapshot you prepare and scrub yourself, or open a recorded native review locally in your browser.
Open guide
Guide
Export one CLI planning run and review its recorded changes, findings, and evidence without database access.
Open guide

Why pgroles?

Record intended access in a version-controlled policy, review the SQL it produces, and reconcile the scope you manage. The policy guide explains how the pieces fit together.

Key features

Use profiles and schemas to reuse privilege rules, default privileges to cover future objects, and planning and reconciliation modes to choose which changes pgroles may make.