On Mon, May 19, 2025 at 03:30:43AM -0700, Dan Mahoney (Ports) wrote:
> 
> 
> > 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:
> [...]
> 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.

Well, you have three choices :

- Upgrade your PostgreSQL server. Using packages means you upgrade
  everything all the time.
- Build your own packages with the default PostgreSQL set to 15.
- Do not upgrade.

The FreeBSD packages system, and ports, is a "rolling release", you have
to move with the flow.

PostgreSQL major version changes have always been difficult, it is not
new.
Until someone (hint, it could be you) automates the upgrades, or allows
multiple version installations by putting each in its own space, like
it's done in other oses, put things in lib/postgresqlXX/{bin,lib},
share/postgresqlXX, you will have to do so the upgrades manually, by
following the instructions in UPDATING.

If you absolutely cannot upgrade your PostgreSQL server, it would
probably be best to move it in a jail on the same machine, all by
itself, so that its version is not linked to the rest of the system, and
you can delay the upgrades the server to a later time.

-- 
Mathieu Arnold

Attachment: signature.asc
Description: PGP signature

Reply via email to