🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #4415

Bug#1153932: trixie-pu: package postgresql-common/278+deb13u1

#4415
From: Christoph Berg
Date: Fri, 13 Nov 2026 19:20
158 lines
7808 bytes
--DTUiQgGf52pkFvmb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: release.debian.org
Severity: normal
Tags: trixie
X-Debbugs-Cc: postgresql-common@packages.debian.org
Control: affects -1 + src:postgresql-common
User: release.debian.org@packages.debian.org
Usertags: pu

Please accept postgresql-common/278+deb13u1 into trixie.

[ Reason ]
It makes pg_buildext, the tool to compile PostgreSQL server
extensions, emit dependencies making sure that an extension compiled
against a PG server with the fix for CVE-2026-6460 also depends on the
version with that fix.

Older server versions were using a macro that now got converted into a
function, so packages compiled against the new version will get linker
errors when trying to run with older servers. The ">> $version"
dependency added prevents that.

[ Impact ]
Things will still work but without proper dependencies. The user can
still upgrade the PG server and extension packages in lockstep.

[ Tests ]
Manual tests confirmed that the dependency gets added, and
t/190_pg_buildext.t is also testing it.

[ Risks ]
The risk is that the generated dependency is bad, but tests have shown
it isn't.

[ Checklist ]
  [x] *all* changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in (old)stable
  [x] the issue is verified as fixed in unstable

[ Other ]
This needs to be accepted before any extension rebuilds are triggered.
(And buildds have to use trixie-proposed-updates.)

Christoph

--DTUiQgGf52pkFvmb
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename=278+deb13u1.diff

commit be5983885ccd673288f357bcfef368b2bf1d985b
Author: Christoph Berg <myon@debian.org>
Date:   Mon Nov 9 15:11:45 2026 +0100

    pg_buildext, /etc/postgresql-common/minor_versions: Set minimum server versions
    
    ... to depend on when extensions are built. Start with the current minor
    versions just being released. This makes sure packages built with the
    fix for CVE-2026-6460 depend on a server with that fix.

diff --git a/debian/changelog b/debian/changelog
index 317ab769..72a366cf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+postgresql-common (278+deb13u1) trixie; urgency=medium
+
+  * pg_buildext, /etc/postgresql-common/minor_versions: Set minimum server
+    versions to depend on when extensions are built. Start with the current
+    minor versions just being released. This makes sure packages built with
+    the fix for CVE-2026-6460 depend on a server with that fix.
+
+ -- Christoph Berg <myon@debian.org>  Fri, 13 Nov 2026 17:09:50 +0100
+
 postgresql-common (278) unstable; urgency=medium
 
   * pg_upgradecluster: Do two vacuumdb runs in analyze hook for PG18+.
diff --git a/debian/minor_versions b/debian/minor_versions
new file mode 100644
index 00000000..eed22d60
--- /dev/null
+++ b/debian/minor_versions
@@ -0,0 +1,11 @@
+# This file is used by pg_buildext to map PostgreSQL major versions to the
+# minimum minor versions that extension packages built against the server
+# should depend on.
+
+20 20~~devel
+19 19~rc2
+18 18.7
+17 17.12
+16 16.16
+15 15.20
+14 14.25
diff --git a/debian/postgresql-common-dev.install b/debian/postgresql-common-dev.install
index 80e03f59..8ab5e238 100644
--- a/debian/postgresql-common-dev.install
+++ b/debian/postgresql-common-dev.install
@@ -1,5 +1,6 @@
 debhelper/Debian /usr/share/perl5
 debhelper/dh_pgxs_test /usr/bin
+debian/minor_versions etc/postgresql-common
 debian/supported-versions usr/share/postgresql-common
 dh_make_pgxs/debian /usr/share/postgresql-common/dh_make_pgxs
 dh_make_pgxs/dh_make_pgxs /usr/bin
diff --git a/pg_buildext b/pg_buildext
index 47b95b3a..4d810a14 100755
--- a/pg_buildext
+++ b/pg_buildext
@@ -4,7 +4,7 @@
 # versions
 #
 # (C) 2010 Dimitri Fontaine <dfontaine@hi-media.com>
-# (C) 2011-2025 Christoph Berg <myon@debian.org>
+# (C) 2011-2026 Christoph Berg <myon@debian.org>
 #
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -91,7 +91,14 @@ substvars() {
     version="$1"
     package="$2"
 
-    depends="postgresql-$version"
+    # for major version $version, look up the minimum minor version to depend on
+    for file in debian/minor_versions /etc/postgresql-common/minor_versions; do
+        if test -f $file; then
+            minor_version=$(awk "/^$version/ { print \$2 }" $file)
+            break
+        fi
+    done
+    depends="postgresql-$version${minor_version:+ (>> $minor_version)}"
     if [ -d "debian/$package/usr/lib/postgresql/$version/lib/bitcode" ]; then
         pg_provides=$(dpkg-query --show --showformat='${Provides}' postgresql-$version | grep -o 'postgresql-[0-9]*-jit-llvm (= [0-9.]*')
         llvm_version=${pg_provides#*= }
diff --git a/t/190_pg_buildext.t b/t/190_pg_buildext.t
index 05f33692..200e3f74 100644
--- a/t/190_pg_buildext.t
+++ b/t/190_pg_buildext.t
@@ -51,6 +51,14 @@ program_ok 'nobody', 'cd foo-123 && DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage
 foreach my $ver (@versions) {
     my $deb = "postgresql-$ver-foo_123-1_$arch.deb";
     ok (-f $deb, "$deb was built");
+    my $info = `dpkg-deb --info $deb control`;
+    like $info, qr/^Depends: postgresql-$ver/m, "correct postgresql dependency";
+    like $info, qr/^Depends: postgresql-$ver \(>> $ver/m, "correct versioned postgresql dependency" if ($ver >= 14);
+    my $dbgsym = "postgresql-$ver-foo-dbgsym_123-1_$arch.deb"; # Debian
+    my $ddbgsym = "postgresql-$ver-foo-dbgsym_123-1_$arch.ddeb"; # Ubuntu
+    ok (-f $dbgsym or -f $ddbgsym, "$dbgsym was built");
+
+    # test in-tree installcheck
     SKIP: {
         my $have_extension_destdir = `grep extension_destdir /usr/share/postgresql/$ver/postgresql.conf.sample`;
         skip "No in-tree installcheck on PG $ver (missing extension_destdir)", 2 unless ($have_extension_destdir);

--DTUiQgGf52pkFvmb--
Technical Details
Message-ID: <NZ4Yx-bGJ3-13@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!srl.newsdeef.eu!news.corradoroberto.it!news.servidellagleba.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!srl.newsdeef.eu!news.corradoroberto.it!news.servidellagleba.it!bofh.it!news.nic.it!robomod
From: Christoph Berg <myon@debian.org>
Newsgroups: linux.debian.bugs.dist,linux.debian.devel.release
Subject: Bug#1153932: trixie-pu: package postgresql-common/278+deb13u1
Date: Fri, 13 Nov 2026 20:20:02 +0100
Message-ID: <NZ4Yx-bGJ3-13@gated-at.bofh.it>
X-Original-To: Debian Bug Tracking System <submit@bugs.debian.org>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Fri Nov 13 19:13:20 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.7
Reply-To: Christoph Berg <myon@debian.org>, 1153932@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: postgresql-common@packages.debian.org, debian-release@lists.debian.org
X-Debian-Pr-Message: report 1153932
X-Debian-Pr-Package: release.debian.org
X-Debian-Pr-Keywords: trixie
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="DTUiQgGf52pkFvmb"
Content-Disposition: inline
X-Reportbug-Version: 13.2.0+nmu1
X-Debian-User: myon
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2002447
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 158
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Fri, 13 Nov 2026 20:12:10 +0100
X-Original-Message-ID: <avdhCj_ZiPcDxqCM@msg.df7cb.de>