> On May 19, 2025, at 02:22, Mathieu Arnold <[email protected]> wrote:
> 
> Hi,
> 
> DBD-Pg links with libpq from the postgresql client port, and libpq from
> 17 can access a postgresql 15 server. Hell, I just tested and using psql
> from a PostgreSQL 17 installation, Ican access a very old server running
> 8.2.
> 
> So, well, I don't understand what is the problem you are trying to
> solve.

Installing different versions of client and server is counterintuitive, and 
usually, database ports won’t let you do it.  Indeed, I hit that issue:

For starters:

pkg install p5-dbd-Pg
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        p5-DBD-Pg: 3.18.0
        postgresql17-client: 17.5

Number of packages to be installed: 2

The process will require 18 MiB more space.

Proceed with this action? [y/N]: y
[1/2] Installing postgresql17-client-17.5...
pkg: postgresql17-client-17.5 conflicts with postgresql15-server-15.12_1 
(installs files into the same place).  Problematic file: 
/usr/local/share/postgresql/postgres.bk

-or-

# pkg install postgresql17-client
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        postgresql17-client: 17.5

Number of packages to be installed: 1

The process will require 17 MiB more space.

Proceed with this action? [y/N]: y
[1/1] Installing postgresql17-client-17.5...
pkg: postgresql17-client-17.5 conflicts with postgresql15-server-15.12_1 
(installs files into the same place).  Problematic file: 
/usr/local/share/postgresql/postgres.bki

For the moment, I got it installed with -f, but that feels wrong.  (This is our 
beta machine, I can afford to mess around with it a bit more).

====

On a different machine (which runs our internal rt instance, for things like 
hostmaster@), running 14.2, It opts to want postgresql-client-16, instead of 
17, even though I explicitly attempt to install postgresql17-client (and it 
deletes postgresql15-client, but fails to install 17-client)

root@ops:/home/dmahoney # pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (138 candidates): 100%
Processing candidates (138 candidates): 100%
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
        postgresql15-client: 15.12_1 -> 15.13

Number of packages to be upgraded: 1

3 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching postgresql15-client-15.13.pkg: 100%    3 MiB   3.3MB/s    00:01
Checking integrity... done (0 conflicting)
[1/1] Upgrading postgresql15-client from 15.12_1 to 15.13...
[1/1] Extracting postgresql15-client-15.13: 100%
root@ops:/home/dmahoney # pkg install postgresql17-client
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        postgresql17-client: 17.5

Number of packages to be installed: 1

The process will require 17 MiB more space.
4 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching postgresql17-client-17.5.pkg: 100%    4 MiB   3.7MB/s    00:01
Checking integrity... done (1 conflicting)
  - postgresql17-client-17.5 conflicts with postgresql15-client-15.13 on 
/usr/local/bin/clusterdb
Checking integrity... done (0 conflicting)
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
The following 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        postgresql17-client: 17.5

Installed packages to be REINSTALLED:
        pkg-2.1.2

Installed packages to be REMOVED:
        postgresql15-client: 15.13

Installed packages to be UPGRADED:
        postgresql15-client: 15.12_1 -> 15.13

Number of packages to be upgraded: 1

3 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching postgresql15-client-15.13.pkg: 100%    3 MiB   3.3MB/s    00:01
Checking integrity... done (0 conflicting)
[1/1] Upgrading postgresql15-client from 15.12_1 to 15.13...
[1/1] Extracting postgresql15-client-15.13: 100%
root@ops:/home/dmahoney # pkg install postgresql17-client
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        postgresql17-client: 17.5

Number of packages to be installed: 1

The process will require 17 MiB more space.
4 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching postgresql17-client-17.5.pkg: 100%    4 MiB   3.7MB/s    00:01
Checking integrity... done (1 conflicting)
  - postgresql17-client-17.5 conflicts with postgresql15-client-15.13 on 
/usr/local/bin/clusterdb
Checking integrity... done (0 conflicting)
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
The following 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        postgresql17-client: 17.5

Installed packages to be REINSTALLED:
        pkg-2.1.2

Installed packages to be REMOVED:
        postgresql15-client: 15.13

Number of packages to be removed: 1
Number of packages to be installed: 1
Number of packages to be reinstalled: 1

The process will require 3 MiB more space.

(try to restart apache, discover that it’s failed to restart, but go to 
reinstall p5-DBD-Pg…and it decides…16 is okay.

root@ops:/var/log/apache24 # pkg unlock p5-DBD-Pg
p5-DBD-Pg-3.18.0: unlock this package? [y/N]: y
Unlocking p5-DBD-Pg-3.18.0
root@ops:/var/log/apache24 # pkg install p5-DBD-Pg
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        postgresql16-client: 16.9

Installed packages to be REINSTALLED:
        p5-DBD-Pg-3.18.0 (direct dependency changed: postgresql16-client)

Number of packages to be installed: 1
Number of packages to be reinstalled: 1

The process will require 16 MiB more space.
4 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/2] Fetching p5-DBD-Pg-3.18.0.pkg: 100%  183 KiB 187.7kB/s    00:01
[2/2] Fetching postgresql16-client-16.9.pkg: 100%    3 MiB   3.5MB/s    00:01
Checking integrity... done (0 conflicting)
[1/2] Installing postgresql16-client-16.9...
[1/2] Extracting postgresql16-client-16.9: 100%
[2/2] Reinstalling p5-DBD-Pg-3.18.0...
[2/2] Extracting p5-DBD-Pg-3.18.0: 100%

Why did it not warn about a conflict between 16-client and 15-server?

====


But also, I’ve absolutely seen a routine pkg upgrade (of all installed 
packages) force an upgrade of postgresql-server to whatever the new default 
version is.  I don’t know why this is: perhaps it’s because we installed 
postgresql15-server, and then it brought along postgresql15-client as a 
dependency, and the upgrade of the client tripped an upgrade of the server.  Or 
maybe since p5-DBD-Pg is tied to “whatever the default is”, it wants an upgrade 
there.  Somehow, there’s a weird depenceny chain between the client and the 
server,

It happened in the past where this upgrade path caused the *server* component 
to force an upgrade, and this is why we’ve got it pkg locked now.

https://lists.freebsd.org/archives/freebsd-ports/2022-January/001294.html

As of right now, things do seem to be behaving with a mismatched client and 
server, but I know I’ve seen this happen in the past, where at the first step, 
pkg says it’s only upgrading one, and then after it downloads the pkg and looks 
at it, it decides it needs to do the server as well.  I’m happy to try to catch 
this again, if it happens.

We’ve also seen this happen with the puppetDB port, but that has an explicit 
dependency on the default version of postgres.

Something is screwy here, and at some point I’ll catch it fully in the act, but 
it should be clear by now that…we wouldn’t be posting here if we hadn’t found 
that all of a sudden, RT has crapped the bed as a result of this.

It’s hard to get good data when this is only respoducible when there’s a 
version bump.  We’re going to snapshot the VMs pre-upgrade in the future so we 
can get better replay.

-Dan

Reply via email to