Hasty Briefsbeta

PG Auto Upgrade – Docker (and K8s) container to auto upgrade your database

8 days ago
  • #Database Upgrade
  • #PostgreSQL
  • #Docker
  • PostgreSQL Docker image for automatic database upgrades.
  • Detects PostgreSQL version in data directory and upgrades using pg_upgrade with --link.
  • Starts PostgreSQL server post-upgrade; old cluster data is removed.
  • Official Docker PostgreSQL image lacks upgrade capability.
  • Warning: Backup data before use; in-place upgrade risks data loss.
  • Remove healthchecks; custom healthcheck implemented.
  • Available on Docker Hub: pgautoupgrade/pgautoupgrade.
  • Use 'latest' tag for Alpine Linux-based image or specific version tags like '17-alpine'.
  • Debian-based images available (e.g., '17-bookworm') for compatibility.
  • One Shot mode for upgrade-only without running PostgreSQL (set PGAUTO_ONESHOT=yes).
  • Skip reindexing with PGAUTO_REINDEX=no (recommended for PG v16+).
  • Bitnami Postgres adjustments: copies missing config files, handles user ID changes.
  • Kubernetes initContainer example provided for Bitnami upgrades.
  • Development image build: 'make dev'.
  • Wiki includes instructions for custom extensions.
  • Breakpoints ('before' and 'server') for debugging/testing.
  • Test script verifies upgrades from PG 9.5 to 17.x using AdventureWorks database.