catalog-conventionslisted
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