From bc9264aedf7c1e4d87851defccbe0d03026fb3f9 Mon Sep 17 00:00:00 2001 From: Gabriele Bartolini Date: Thu, 19 Nov 2026 23:00:52 +0100 Subject: [PATCH 1/2] fix: install pg-failover-slots only for PostgreSQL 15 and 16 PostgreSQL 17 and later natively support failover slots, and the pg-failover-slots package is not available for PostgreSQL 19. Add an extensionsMaxMajor map to docker-bake.hcl so that an extension is only installed up to a given major, and cap pg-failover-slots at 16. Assisted-by: Claude Signed-off-by: Gabriele Bartolini --- README.md | 3 +++ docker-bake.hcl | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6aa35ca4..43af297e 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,9 @@ following additional features: - PGAudit - Postgres Failover Slots + - For PostgreSQL 16 and earlier: included + - From PostgreSQL 17 onwards: not included, as PostgreSQL natively + supports failover slots - pgvector - All Locales - LLVM JIT support diff --git a/docker-bake.hcl b/docker-bake.hcl index ce3840ca..622c4293 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -47,6 +47,13 @@ extensions = [ "pg-failover-slots" ] +// Extensions that are only built for PostgreSQL majors up to (and including) +// the given one. pg-failover-slots is not needed from PostgreSQL 17, which +// natively supports failover slots. +extensionsMaxMajor = { + "pg-failover-slots" = 16 +} + target "default" { matrix = { tgt = [ @@ -155,7 +162,10 @@ function getMajor { function getExtensionsString { params = [ version, extensions ] - result = (isPreview(version) == true) ? "" : join(" ", formatlist("postgresql-%s-%s", getMajor(version), extensions)) + result = (isPreview(version) == true) ? "" : join(" ", [ + for e in extensions : format("postgresql-%s-%s", getMajor(version), e) + if getMajor(version) <= lookup(extensionsMaxMajor, e, 999) + ]) } // This function conditionally adds recommended PostgreSQL packages based on From adfb0f127d445ce0d3be402742a327965ae8513e Mon Sep 17 00:00:00 2001 From: Marco Nenciarini Date: Fri, 20 Nov 2026 08:56:31 +0100 Subject: [PATCH 2/2] fix: keep pg-failover-slots up to PostgreSQL 18 Raise the extensionsMaxMajor cap from 16 to 18. The package is only missing for PostgreSQL 19. Keeping it on 17 and 18 lets clusters that preload pg_failover_slots upgrade in place. Signed-off-by: Marco Nenciarini --- README.md | 6 +++--- docker-bake.hcl | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 43af297e..b8a087be 100644 --- a/README.md +++ b/README.md @@ -102,9 +102,9 @@ following additional features: - PGAudit - Postgres Failover Slots - - For PostgreSQL 16 and earlier: included - - From PostgreSQL 17 onwards: not included, as PostgreSQL natively - supports failover slots + - For PostgreSQL 18 and earlier: included + - From PostgreSQL 19 onwards: not included, as the package is not + available - pgvector - All Locales - LLVM JIT support diff --git a/docker-bake.hcl b/docker-bake.hcl index 622c4293..2d53c3c4 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -47,11 +47,11 @@ extensions = [ "pg-failover-slots" ] -// Extensions that are only built for PostgreSQL majors up to (and including) -// the given one. pg-failover-slots is not needed from PostgreSQL 17, which -// natively supports failover slots. +// Extensions that are only installed for PostgreSQL majors up to (and +// including) the given one. pg-failover-slots is not available from +// PostgreSQL 19. It stays on 17 and 18 to ease upgrades. extensionsMaxMajor = { - "pg-failover-slots" = 16 + "pg-failover-slots" = 18 } target "default" {