Provides PostgreSQL-specific guidance for Atlas schema management: dev databases, extensions, roles, privileges, migrations, custom lint rules, and managed services (RDS, Cloud SQL, Supabase, Neon, Azure). Use alongside the atlas skill.
Ships in Atlas. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
What is specific to PostgreSQL when Atlas manages the schema. The atlas skill covers the workflows and
commands; this skill covers the rules, edge cases, and answers that differ on PostgreSQL.
PostgreSQL-compatible engines, such as CockroachDB, YugabyteDB, and Aurora DSQL, behave differently in
places: follow their guides (https://atlasgo.io/databases).
This skill is SKILL.md plus seven reference files under references/, each served at
https://atlasgo.io/skills/atlas-postgres/references/<name>. Read a reference when the task needs it:
| File | Read it for |
|---|---|
references/dev-database.md | The dev URL and its scope, atlas tool docker, the docker block and baseline, extensions, RDS, Cloud SQL, Supabase, Neon, Azure, connection URLs |
references/security.md | Roles and users, GRANT and REVOKE, default privileges (ALTER DEFAULT PRIVILEGES, default_permission), ownership, row-level security, provider admin roles |
references/objects.md | Sequences, serial and identity columns, enums, domains, column type changes, functions, triggers, views, partitions, indexes, what Atlas does not manage |
references/hcl.md | Writing the schema in HCL: the NOT NULL default, column types and sql(), defaults, references, keys, indexes, table settings, function bodies, seed data, input variables |
references/migrations.md | Locks and concurrent indexes, PG* lint findings, transactions, connection poolers, lock-safe NOT NULL, seed data |
references/custom-rules.md | Writing a custom lint rule in the HCL rule language when no analyzer covers a check: predicates, operators, what each PostgreSQL object exposes, examples |
references/testing.md | Testing every change: schema tests for functions, triggers, views, domains, and policies, migration tests with seeded rows, row-level security tests, template databases, pgTAP |
The atlas skill, installed next to this one (../atlas/SKILL.md). If it is missing, download
https://atlasgo.io/skills/atlas/SKILL.md to ../atlas/SKILL.md and each reference file listed in its
Files section to ../atlas/references/<name>.
atlas whoami. If it shows no login, ask the user to run atlas login:
logged out, Atlas misses most of a PostgreSQL schema. Inspection silently skips views, functions,
triggers, sequences, extensions, partitions, and policies, and a desired state that defines them
fails with an error containing are available to logged-in users only. A user without an account
can start a free trial with atlas login.search_path: Atlas manages that one schema and writes unqualified
statements (users). Database scope, no search_path: Atlas covers every schema and qualifies
each statement (public.users).search_path=public,
which exists in every new database, whatever schema the target names; a dev database you provide
can use any empty schema.docker://postgres/<version>/dev.
Create what the schema uses but does not manage, such as extensions, provider roles, or other
teams' schemas, in a docker block baseline. Never point dev at a real environment's database.references/security.md, Default
Privileges):
default_permissions off. ALTER DEFAULT PRIVILEGES in the desired state never appears in a
migration: Atlas runs it on the dev database and plans one GRANT per object it covers. Put it
before those objects, without FOR ROLE.mode "postgres" { default_permissions = true }. Never
enable it in an env that migrates the schema: default privileges only decide what objects created
later get.mode { roles = true }. Mark every role Atlas must not change
with external = true, and create the external roles that grants name in the dev baseline. On a
managed service, exclude the provider's admin role
(references/security.md, Managed Providers).concurrent_index diff policy, or a
hand-written file that starts with -- atlas:txmode none. Never write BEGIN or COMMIT in a
migration file: Atlas runs each file in a transaction unless it sets txmode none.CHECK constraints and foreign keys NOT VALID, then validate them in a separate transaction:
a txmode none file, or a later file. Use the lock-safe NOT NULL policy on large tables.-pooler endpoint, or PgBouncer in
transaction mode. The advisory lock Atlas holds for the run is per session, and these poolers drop
it; Supabase and Neon both document the direct connection for migrations.references/objects.md):
text to integer or uuid, needs a
USING clause.serial needs a setval, or inserts fail on duplicate keys.serial to bigserial needs ALTER SEQUENCE ... AS bigint, or the sequence still stops at
2147483647.atlas schema validate, add a
test "schema" case for each function, trigger, view, domain, check, or policy you add or change,
and a test "migrate" case with seeded rows for each migration that moves or converts data. Run
them with atlas schema test and atlas migrate test (references/testing.md).references/custom-rules.md).| Question | Answer |
|---|---|
| A local PostgreSQL database to apply migrations to | atlas tool docker --url "docker://postgres/17/myapp?search_path=public" --name my-db prints its URL; atlas tool docker kill --name my-db stops it (references/dev-database.md) |
cannot drop type ... because other objects depend on it, or views and functions missing from a plan | Run atlas whoami: logged out, Atlas skips views and functions, including the ones that depend on the type (Rule 1) |
| Which URL to give Atlas on Supabase, Neon, or behind PgBouncer | The direct connection, never the transaction-mode pooler (references/migrations.md, Connection Poolers) |
pq: unsupported startup parameter: search_path | The URL goes through PgBouncer; use the direct connection (references/migrations.md, Connection Poolers) |
CREATE EXTENSION is missing from the migration | The URLs are schema-scoped; extensions need database scope (references/dev-database.md) |
A plan drops the public schema | At database scope, the desired state covers every schema: declare schema "public" {}, or use schema-scoped URLs (references/dev-database.md) |
cannot diff a schema with a database connection | The URL and the dev URL have different scopes (references/dev-database.md) |
connected database is not clean | dev points at a database that is not empty (references/dev-database.md) |
| The same change shows up in every plan | Set a dev URL with the target's scope: Atlas normalizes defaults and expressions on it (references/dev-database.md) |
A column became NOT NULL without asking for it | HCL columns are NOT NULL unless they set null = true (references/hcl.md) |
ALTER COLUMN ... TYPE fails for text to integer or uuid | Add a USING clause to the migration file (references/objects.md, Column Changes) |
Inserts fail with a duplicate key after a column became serial | Move the sequence with setval (references/objects.md) |
| An enum value was removed, but the diff reports no changes | Removing enum values is not planned: write the change by hand (references/objects.md, Enums) |
unsafe use of new value | Add the enum value and its first use in separate migration files (references/objects.md, Enums) |
pq: type "geometry" does not exist | Create the extension in the schema or the dev baseline; the PostGIS image alone does not install it (references/dev-database.md) |
Lint reports PG101 or PG103 on an index | Use the concurrent_index policy or atlas:txmode none (references/migrations.md) |
| A convention must hold on every table, such as row-level security or foreign-key indexes | Write a custom lint rule (references/custom-rules.md) |
| A row-level security test passes whatever the policy says | The dev database connects as a superuser, which bypasses policies; test as a non-privileged role (references/testing.md) |
pq: unexpected transaction status idle | Remove BEGIN/COMMIT from the file: Atlas already runs it in a transaction (references/migrations.md) |
ambiguous revision table after changing the URL's scope | Set --revisions-schema to the schema that holds the existing table (references/migrations.md) |
DROP and CREATE is required on a partitioned table | Changing a partition key, or partitioning an existing table, needs a hand-written migration (references/objects.md) |
ERROR: out of shared memory on the dev database | Raise max_locks_per_transaction above 128 in the docker block (references/dev-database.md) |
| An event trigger is missing from the migration | Use a database-scoped dev URL (references/objects.md) |
Every plan revokes from postgres (Cloud SQL), the RDS master user, or another provider admin | Plan through a dev database where the admin is an ordinary role (references/security.md, Managed Providers) |
A new role needs SELECT on thousands of tables | Make it a member of pg_read_all_data instead of granting per table (references/security.md) |
Objects on the dev database belong to postgres, but production has other owners | Owners are not part of the desired state (references/security.md, Ownership) |
The migration has no ALTER DEFAULT PRIVILEGES | Expected: Atlas plans the GRANTs it implies, per object (references/security.md) |
permission denied to change default privileges | The user Atlas connects as needs the privileges of the owner role: GRANT <owner> TO <atlas user> WITH INHERIT TRUE (references/security.md, When another tool creates the objects) |
postgres: managing default permissions requires enabling "default_permissions" in the schema mode | default_permission blocks need mode "postgres" { default_permissions = true }, in an env that manages access only (Rule 4) |
postgres: default_permission blocks are not supported in schema scope, remove search_path from the URLs | Default privileges belong to the database: remove search_path from both url and dev |
A default_permission change is planned again on every run | The block grants to a superuser, a predefined pg_* role, or the owner itself. Atlas does not manage these, so delete the block |
A grant on a sequence turned a bigserial column into bigint | Expected: the sequence is now managed explicitly (references/objects.md) |
references/custom-rules.md (opens in a new tab)references/dev-database.md (opens in a new tab)references/hcl.md (opens in a new tab)references/migrations.md (opens in a new tab)references/objects.md (opens in a new tab)references/security.md (opens in a new tab)references/testing.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/atlas:atlas-postgresfrom Atlas
npx claudepluginhub ariga/atlas --plugin atlas14 skills in this plugin
/atlasDatabase schema management, migrations, data scripts, and Atlas Cloud operations with the Atlas CLI. Use when: generating or applying migrations, diffing, linting, validating, or testing schemas, working with atlas.hcl, schema.hcl, or ORM schemas (GORM, Drizzle, SQLAlchemy, Django, Ent, Sequelize, TypeORM, Prisma), running data backfills, purges, or reports with atlas script, or answering questions about Atlas Cloud: which databases are synced, pending, or failed, recent or failed deployments, what is waiting for deployment, registry repos, and pending plan approvals./atlas-actionAtlas in CI/CD pipelines with the Atlas actions: ariga/setup-atlas and ariga/atlas-action on GitHub Actions, the GitLab CI components, the CircleCI orb, the Bitbucket pipe, and the Azure DevOps AtlasAction task. The CI/CD steps (migrate lint, push, diff, hash, autorebase, test, apply, down, set, drift; schema plan, plan approve, push, apply, lint, test; script exec, query, loop, test, push; security scan; monitor schema; create-repo) with its inputs, outputs, tokens, permissions, and pull request comments, plus pinning versions, runners, and fixing a failed run. Use with the atlas skill whenever a pipeline runs Atlas or an Atlas check in CI fails./atlas-clickhouseClickHouse specifics for Atlas: the login-only driver, dev database and URL scope (database vs server), Docker dev images and version checks, cluster mode and ON CLUSTER, table engines, sort keys and table rebuilds, plans that skip destructive changes without a terminal, table recreation and the allow_recreate policy, mutations and CH lint checks, materialized views, dictionaries, UDFs and WASM, named collections, users, roles, grants, row policies and settings profiles, secret settings and the sensitive mode, no transactions and no lock, ClickHouse Cloud, schema and migration tests, and custom lint rules. Use with the atlas skill whenever Atlas manages a ClickHouse database./atlas-databricksDatabricks specifics for Atlas: the extended binary and login, connection URLs and scope (catalog vs schema), the dev catalog (no Docker), Delta table properties, managed and external tables, partitioning and liquid clustering, generated and identity columns, defaults and column mapping, renames, informational keys and checks, collations, column masks and row filters, views, metric views, and materialized views, SQL and Python functions, procedures, Unity Catalog grants, no transactions and no locks, partial failures, schema and migration tests, and custom lint rules. Use with the atlas skill whenever Atlas manages a Databricks database. For Databricks Lakebase, use atlas-lakebase./atlas-lakebaseDatabricks Lakebase specifics for Atlas: the databricks_lakebase_token data source and the Databricks credentials it uses (a CLI profile, or a service principal with the workspace-access entitlement), the endpoint host instead of the -pooler host, the Postgres role in the URL, password roles, the objects Lakebase manages in every database (__db_system, three grant_* functions, three on_create_* event triggers) and how to exclude them at schema and database scope, the first migrate apply, drift checks, object ownership, and Lakebase errors. Use with the atlas and atlas-postgres skills whenever Atlas manages a Databricks Lakebase database./atlas-mssqlSQL Server specifics for Atlas (also Azure SQL and MSSQL): login, Azure SQL sign-in with Microsoft Entra ID (fedauth, no password), dev database and URL scope (mode=schema vs mode=database, the database query parameter), compatibility level and collation, system-generated constraint names, clustered index defaults and datetime2 precision in HCL, GO batches and the delimiter directive, transactions and statements that cannot run in one, identity, computed and temporal columns, alias and table types, changes planned as a drop and an add, what Atlas leaves out (DENY, synonyms, row-level security, sparse columns), database roles, users and grants, schema and migration tests, and custom lint rules. Use with the atlas skill whenever Atlas manages a SQL Server or Azure SQL database.Other plugins' skills for the same job