Read the extensions catalog v3 and filter extension builds by Postgres minor

A CVE fix in the latest Postgres minors (14.25, 15.20, 16.16, 17.12 and 18.7) changed the ABI of the server, so an extension build no longer runs on every minor of its Postgres major. The extensions repository publishes the new builds only in a new version of its catalog, v3/index.json and v3/hashes.json, and v2 is frozen. The builds for the new minors carry availableFor[].postgresFromVersion, the minimum full Postgres version that can run them, and the previous builds that do not run on the new minors carry availableFor[].postgresToVersion, the maximum full Postgres version that can run them. Both bounds are inclusive (see ongresinc/builder/extensions#216).

The operator must:

  • read only v3/index.json, without falling back to v2/index.json: v2 has no postgresToVersion, so it would offer builds that do not run on the new minors. A custom repository, a mirror or the extensions cache must serve v3;
  • never install a build whose postgresFromVersion is greater than, or whose postgresToVersion is lower than, the full Postgres version of the cluster, so that a cluster on an older minor gets the older build and a cluster upgraded to a newer minor gets the newer one;
  • download and serve only v3 in the extensions cache, without falling back to v2.

Clusters running the Postgres minors released with this fix require this operator version to get extension builds that work on them.

Edited by Matteo Melli