← ClaudeAtlas

build-and-runlisted

Build, install, initdb, and start PostgreSQL from source in the `dev/` clone for backend hacking — covers meson setup (PG ≥ 16 default) with cassert + debug flags, the autoconf ./configure fallback, ninja install, initdb + pg_ctl start / stop, PGDATA / PATH wiring, single-user mode for postmaster startup debugging, attaching gdb / lldb under the per-connection fork model, and -O0 -g3 debug builds. Use whenever a task involves compiling PG from source in dev/, running ninja install on the dev clone, initdb-ing a fresh data directory, starting or stopping the dev cluster via pg_ctl, picking between the debug profile (5432) and ASan profile (5433), or attaching a debugger to a forked backend. Skip for brew / apt / yum / Docker / k8s installation of release PG, Aurora / Cloud SQL / Supabase / Neon-managed PG provisioning, generic CMake / make / Bazel build questions, Linux-kernel builds, Node.js / Python / Go application builds, and pgAdmin / DBeaver client installation.
matejformanek/postgres-claude · ★ 0 · AI & Automation · score 70
Install: claude install-skill matejformanek/postgres-claude
# build-and-run ## Slash-command wrappers (use these first) The recipes in this skill are also exposed as slash commands under `.claude/commands/`. Prefer them — they encode the right flags and guardrails: - `/setup-pg` — first-time meson setup + build + install (idempotent; `--force` to reconfigure). - `/pg-start`, `/pg-stop`, `/pg-restart` — lifecycle. - `/pg-psql` — `psql -h /tmp -d postgres` against the dev cluster. - `/pg-test [--suite NAME] [--test PAT]` — meson test, always prepends `--suite setup` so the initdb-template trap can't bite. - `/pg-attach` — get a backend PID and print the `lldb -p` line. - `/pg-tail-log` — follow `dev/data-debug/server.log`. - `/pg-fresh --yes` — wipe `data-debug/`, re-initdb (preserves the build). - `/pg-reclone-dev` — nuclear: re-clone the whole dev tree from the read-only reference. - `/setup-pg-asan` / `/pg-start-asan` — sibling profile built with AddressSanitizer + UndefinedBehaviorSanitizer (see "Sanitizer builds" below); use this when chasing memory bugs or undefined behavior. The rest of this file is the underlying mechanics, for cases where you need to deviate from the wrappers. ## Running these from a git worktree (gotcha) Every `/pg-*` command above resolves paths via `$PWD/dev/...` and `$PWD/source/...`. The `dev` and `source` symlinks live at the **root of the postgres-claude repo**, and `git worktree add` (or this project's `EnterWorktree` tool) does NOT propagate them into the new worktree. Inside a worktree