← ClaudeAtlas

catalog-conventionslisted

Add or modify a PostgreSQL system-catalog entry — covers adding a pg_proc.dat builtin function, pg_operator.dat operator, pg_type.dat type, pg_cast.dat cast, pg_opclass.dat opclass, adding a new column on pg_class / pg_aggregate / pg_attribute / etc., BKI bootstrap entries, OID assignment policy (genbki.pl, unused_oids), catversion (CATALOG_VERSION_NO) bumping, and regenerating postgres.bki. Use whenever a PG patch edits anything under src/include/catalog/ (.h or .dat), adds a SQL-visible builtin (function/operator/type/cast/opclass), assigns or recycles an OID, or bumps the catversion. Skip for user-level information_schema queries on a running server, Django / Alembic / Rails / Flyway / Liquibase migrations, Oracle DBA_* / MySQL information_schema / Snowflake INFORMATION_SCHEMA catalog questions, schema design and normalization advice, ER-diagram tooling, and adding constraints to user-application tables.
matejformanek/postgres-claude · ★ 0 · API & Backend · score 70
Install: claude install-skill matejformanek/postgres-claude
# Catalog modification checklist Background: `knowledge/idioms/catalog-conventions.md`. This skill is the hands-on procedure; consult it before/after any change to `src/include/catalog/*.h` or `*.dat`. ## Before you start 1. **Decide which catalog(s) you touch.** Common patterns: - New builtin function → `pg_proc.dat` (+ C function in some backend file). - New operator → `pg_operator.dat` + `pg_proc.dat`. - New cast → `pg_cast.dat` + `pg_proc.dat`. - New type → `pg_type.dat` + I/O funcs in `pg_proc.dat`. - New column on existing catalog → edit `pg_X.h`, decide BKI_DEFAULT, possibly update every existing row in `pg_X.dat`. - New catalog table entirely → new `pg_X.h` + `pg_X.dat` + entries in `src/include/catalog/Makefile` / `meson.build` + `headers` list in `src/backend/catalog/Makefile`. 2. **Pick OIDs.** From `src/include/catalog/`: ```sh ./unused_oids ``` Pick a *random* starting OID in **8000-9999** and a contiguous block big enough for your patch. The 8000-9999 range is reserved by project convention for in-progress patches and forks (see `src/include/access/transam.h` comments around `FirstGenbkiObjectId`); keeping new work in that range minimises collisions with concurrent patches. 10000-11999 is reserved for genbki.pl auto-assignment, and the committer renumbers your patch down to a tidy low-OID range via `renumber_oids.pl` at commit time — don't do that yourself in in-flight work. ## Making the