All,

I’ve lost another morning to a bad choice made by ports/pkg.

Maybe this is a dumb question/rant, but recently, a routine pkg upgrade of the 
dayjob’s RT VM (which included an upgrade to perl) decided to leave me with no 
ability to connect.  After following the rabbit hole, I hit a database connect 
error.

p5-dbd-pg was still installed, according to pkg, but none of the perl libraries 
could find it, because it was in the wrong perl include dir 
(/usr/local/lib/perl5/site_perl/mach/5.32/DBD/Pg.pm, when the perl version was 
5.34)

Now, postgresql13 is still in pkg, still works, and according to Freshports 
indirectly requires postgresql13 (by way of requining libpq), and it still 
builds cleanly if you set DEFAULT_VERSIONS+=pgsql=13 in make.conf, 

But apparently, if you use pkg, and you try to decide you need the perl driver, 
you’re boned.  But should you attempt to just reinstall it?  Nope.

# pkg install p5-DBD-Pg
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (2 conflicting)
 - postgresql15-client-15.4 conflicts with postgresql13-client-13.12 on 
/usr/local/bin/clusterdb
 - postgresql15-client-15.4 conflicts with postgresql13-client-13.12 on 
/usr/local/bin/clusterdb
Checking integrity... done (0 conflicting)
The following 5 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
       postgresql13-client: 13.12
       postgresql13-server: 13.12

New packages to be INSTALLED:
       postgresql15-client: 15.4

Installed packages to be UPGRADED:
       p5-DBD-Pg: 3.16.0 -> 3.17.0

Installed packages to be REINSTALLED:
       pkg-1.20.8

===

Also, I love how it doesn’t offer to upgrade the server as well.  Who needs 
that thing?

So the point of view is apparently “yeah, you can install a whole big postgres 
server/client, and a big language like perl, and all the dependencies for 
something complicated like RT without having a full ports tree, but if you try 
to install the tiny little stub that lets perl talk to that database, HAHA 
nope."

This happened a year ago, too.  It’s not freebsd’s fault that Postgres requires 
a full dump and restore of all your databases to do an upgrade (where mysql 
handles major version upgrades just fine), but the version bumps should be 
cognizant  of this.

My fix for this was *sigh* portsnap fetch updete, cd 
/usr/ports/databases/p5-dbd-Pg, make, make deinstall, make reinstall…pkg lock 
p5-dbd-Pg

Yes, I know that I should be ready to upgrade to 15 at some point, on whatever 
quarterly port boundary it’s decided, “I guess that’s when”, with no advance 
notice, via the full stupid dump-and-restore process.

I don’t run “pkg upgrade” because I’m interested in the exercise of debugging 
the latest ports shenanigans, I run it because “pkg audit” complains at me 
about vulnerable things, and in general it’s good to keep things up to speed

But once in a while, I lose a whole morning to nonsense like this, and it feels 
preventable.

-Dan

Reply via email to