db/'s suites skip themselves when DOLTSRHT_TEST_PG is unset, and go test ./...
still prints ok for the package — so "the tests pass" says nothing about the
persistence layer unless a DSN was exported. CI (.build.yml) provides one; locally
there is no daemon running by default, but homebrew postgresql@18 is installed
(/opt/homebrew/opt/postgresql@18/bin, brew services status none). Docker is not
an option by default — OrbStack is usually not running.
Throwaway cluster, no brew services, no trace left:
export PATH="/opt/homebrew/opt/postgresql@18/bin:$PATH"
initdb -D "$SP/pgdata" -U "$(id -un)" --auth=trust
SOCK=$(mktemp -d /tmp/pg.XXXX) # NOT under the scratchpad — see below
pg_ctl -D "$SP/pgdata" -o "-p 55432 -k $SOCK -c listen_addresses=127.0.0.1 -c fsync=off" \
-l "$SP/pg.log" start
createdb -h 127.0.0.1 -p 55432 doltsrht_test
export DOLTSRHT_TEST_PG="postgresql://$(id -un)@127.0.0.1:55432/doltsrht_test?sslmode=disable"
go test -tags gms_pure_go -v ./db/ # then: pg_ctl -D "$SP/pgdata" stop -m fast
The trap: a unix socket path may be at most 103 bytes, and the session scratchpad
(/private/tmp/claude-502/<slug>/<uuid>/scratchpad) is already longer than that. -k
pointed there makes postgres exit with "Unix-domain socket path is too long" after
pg_ctl has reported nothing useful; the only sign is in the log file. Put the socket
dir under a short /tmp path and talk to the server over 127.0.0.1.
Verify the suite actually ran rather than skipped — count --- PASS under -v and
expect zero --- SKIP (see verify-recipes-that-lie). A full db/ run is ~22 PASS.