{
  "schemaVersion": "ebb.rule.v1",
  "id": "container.postgres.eol-13-and-older",
  "ecosystem": "container",
  "purl": "pkg:docker/library/postgres",
  "affectedVersions": "vers:semver/<14.0.0",
  "event": "end-of-life",
  "severity": "high",
  "title": "PostgreSQL image major versions 13 and older are end-of-life",
  "summary": "The PostgreSQL project no longer releases fixes for these major versions.",
  "replacement": "A postgres image on a supported major version (the upgrade needs a dump/restore or pg_upgrade)",
  "deadline": "2025-11-13",
  "sources": [
    {
      "title": "PostgreSQL versioning policy",
      "url": "https://www.postgresql.org/support/versioning/",
      "accessedAt": "2026-10-16"
    }
  ],
  "provenance": {
    "observedAt": "2026-10-16",
    "reviewedAt": "2026-10-16",
    "reviewer": "arminazimi"
  },
  "migration": {
    "constraints": [
      "A major PostgreSQL upgrade does not reuse the old data directory: the data must be dumped and restored, or migrated with pg_upgrade, before the new image can start on it.",
      "Check extensions, client libraries, and any init scripts against the target major version, and take a backup first."
    ],
    "steps": [
      {
        "id": "update-image-declaration",
        "title": "Update the base image",
        "instructions": "Change the reported FROM line or Compose image to a tag on a supported release line, and pin it to a digest if your policy requires.",
        "targets": "declaration"
      },
      {
        "id": "align-image-surfaces",
        "title": "Align other image references",
        "instructions": "Update other Dockerfiles, Compose files, CI service containers, and deployment manifests that use the same image so they agree.",
        "targets": "all"
      }
    ],
    "verification": [
      {
        "command": "docker compose config",
        "purpose": "Validate the Compose file after changing the image tag."
      },
      {
        "command": "docker compose run --rm db postgres --version",
        "purpose": "Confirm the database container runs the intended major version (service name may differ)."
      }
    ]
  }
}
