connection
🔒 Passwords are never stored. Use ~/.pgpass or PGPASSWORD in your shell. Profiles live only in this browser's localStorage.
builder
recipes
security
Roles, audits, SSL, row-level security and logging for PostgreSQL 13–17. RDS/Aurora marks items that only apply there. On RDS the master user is a member of rds_superuser, not a real superuser, and server settings go in the parameter group.
Security role builder
Database CONNECT
Predefined (system) roles
pg_database_owner is not grantable (membership is implicit for the database owner), so it is not offered.Database role model (reader / writer / app_user)
Generates a re-runnable psql script that creates a NOLOGIN owner and three access roles chained by membership. It validates its inputs and stops on the first error, then prints a verification report.
| Role | Gets | How |
|---|---|---|
owner {db}_owner | Owns the database, schemas and all objects. Runs DDL and migrations via SET ROLE. | NOLOGIN. The admin running the script is granted it (required on RDS: master user → owner). |
reader {db}_reader | CONNECT; USAGE on the schemas; SELECT on tables, views and sequences | Direct grants plus ALTER DEFAULT PRIVILEGES FOR ROLE owner for future objects |
writer {db}_writer | reader + INSERT/UPDATE/DELETE (TRUNCATE optional); USAGE/SELECT/UPDATE on sequences; EXECUTE on functions | GRANT reader TO writer (inherits), plus its own grants and default privileges |
app_user {db}_app_user | writer + TEMP tables. The role the application connects with; no CREATE anywhere, so no DDL. | GRANT writer TO app_user; search_path set to the managed schemas |
| PUBLIC | Nothing (with the revoke option): no CONNECT/TEMP on the database, no CREATE in schema public, no EXECUTE on new functions | REVOKE … FROM PUBLIC |
Keep current owners (existing databases, e.g. Aurora): the owner row above doesn't apply. Objects keep their owners, and each one is granted to reader/writer individually. Default privileges are added FOR ROLE each role that owns objects in the managed schemas (auto-detected or listed), so future objects from any of them are covered. Foreign tables get the same table grants. Querying them also needs a user mapping for the role (or PUBLIC). USAGE on the foreign server is optional; it only lets reader create its own user mappings or foreign tables.
Why membership: each privilege is granted once, so writer can never fall behind reader. The roles must be INHERIT, which the script enforces. A NOINHERIT role would only get the privileges after SET ROLE, which apps don't do. People get access by being granted one of the three roles (GRANT {db}_reader TO alice). RDS/Aurora: there's no superuser, so run it as the master user (rds_superuser, CREATEROLE, CREATEDB). The script grants the owner role to that user, because CREATE DATABASE … OWNER, SET ROLE and ALTER DEFAULT PRIVILEGES FOR ROLE all require it.
admin tools
Generators for day-to-day DBA work: default privileges, privilege audits, ownership fixes, dropping roles, login users and session/lock troubleshooting. Each one builds its script from the form; nothing runs from the page.
sample data
Practice schema demo (customers, products, categories, orders, order_items) with data loaders and queries from basic to advanced. Run it on a practice database:
psql -d mydb -v ON_ERROR_STOP=1 -f demo.sql
The full script runs the schema, hand-written inserts, generated data (with these counts) and every query. Cleanup is included but commented out.