Sangeetha-Grantha

Metadata Value
Track ID TRACK-072
Title PostgreSQL 18 Upgrade (15 → 18.3)
Status Completed
Created 2026-02-28
Author Sangeetha Grantha Team

TRACK-072: PostgreSQL 18 Upgrade

Objective

Upgrade PostgreSQL from version 15 to 18.3 across all environments (local Docker, staging Cloud SQL, production Cloud SQL).

Motivation

Scope

Files Changed

File Change
compose.yaml Docker image postgres:15postgres:18; volume mount path updated for PG 18 layout
application_documentation/08-operations/deployment.md Cloud SQL POSTGRES_15POSTGRES_18
application_documentation/08-operations/runbooks/database-runbook.md Version table 15 → 18
application_documentation/02-architecture/tech-stack.md PostgreSQL 15+ → 18+
.cursorrules PostgreSQL 15+ → 18+
CLAUDE.md PostgreSQL 15+ → 18+
conductor/tracks.md Add TRACK-072 entry
database/migrations/37__pg18_uuidv7_defaults.sql Switch all 27 UUID PK defaults from gen_random_uuid() to uuidv7()

Not Changed (No Action Needed)

Migration Notes (Local Development)

After pulling these changes, developers must recreate their local database volume:

# Stop and remove old container + volume
docker compose down -v

# Start with new PG 18 image and re-seed
mise exec -- cargo run --manifest-path tools/sangita-cli/Cargo.toml -- dev --start-db

Risk Assessment

Progress Log

Date Description
2026-02-28 Created track, updated all version references
2026-02-28 Added migration 37: switch 27 tables from gen_random_uuid() to uuidv7()
2026-02-28 Fixed compose.yaml volume mount for PG 18 data directory layout change (/data → parent dir)

All migrations apply cleanly against PG18. UUIDv7 defaults active.