Thanks to @FroggyFlox & forum members agjbond007 & anborn; for helping to identify this issue. It is currently supposed that, as a result of zypper dup OS version transitions, given examples were (15.3->15.4) & (15.2->15.3->15.4) the, required for Poetry venv build, pg_config file can become unrepresented: i.e. no longer having an alternatives link. This file, as installed by our dependence on:
postgresql13-server-devel
Is normally available via:
rleap15-5:~ # rpm -q --whatprovides /usr/bin/pg_config
postgresql13-server-devel-13.10-150200.5.37.1.x86_64
rleap15-4:~ # ls -lah /usr/bin/pg_config
lrwxrwxrwx 1 root root 27 Nov 14 2022 /usr/bin/pg_config -> /etc/alternatives/pg_config
rleap15-4:~ # ls -lah /etc/alternatives/pg_config
lrwxrwxrwx 1 root root 35 Nov 14 2022 /etc/alternatives/pg_config -> /usr/lib/postgresql13/bin/pg_config
rleap15-4:~ # update-alternatives --list postgresql
/usr/lib/postgresql13
However, during a zypper dup, the new default postgresql version of 14 is installed as per agjbond007 report in the linked forum thread:
i | postgresql | Basic Clients and Utilities for PostgreSQL | package
i | postgresql-devel | PostgreSQL development header files and libraries | package
i | postgresql-llvmjit | Just-in-time compilation support for PostgreSQL | package
i | postgresql-llvmjit-devel | Helper package to pull all dependencies to build with llvm support | package
i | postgresql-server | The Programs Needed to Create and Run a PostgreSQL Server | package
i | postgresql-server-devel | PostgreSQL server development header files and utilities | package
i | postgresql13 | Basic Clients and Utilities for PostgreSQL | package
i | postgresql13-devel | PostgreSQL client development header files and libraries | package
i | postgresql13-llvmjit | Just-in-time compilation support for PostgreSQL | package
i | postgresql13-llvmjit-devel | PostgreSQL development files for extensions with LLVM support | package
i | postgresql13-server | The Programs Needed to Create and Run a PostgreSQL Server | package
i | postgresql13-server-devel | PostgreSQL server development header files and utilities | package
i | postgresql14 | Basic Clients and Utilities for PostgreSQL | package
i | postgresql14-llvmjit | Just-in-time compilation support for PostgreSQL | package
i | postgresql14-server | The Programs Needed to Create and Run a PostgreSQL Server
But in the above we see that there is no counterpart to the postgresql13-server-devel installed in the 14 variant, and thus no counterpart provider (via alternatives) of our required pg_config - used by our Poetry dependencies manager to build our Python dependencies upon install/update.
The fix provided by @FroggyFlox in the linked forum thread is to re-assert our dependency upon postgresql13 (and it's server-devel counterpart) via a move away from the auto alternative (as higher priority due to newer) which has unfortunately obscured (removed from alternative managed path) the requried for venv build 'pg_config' utility.
The following shows the by-hand intervention currently required for installs that have previously been 'zypper dup' (distribution updated) from a prior Leap version:
alternatives --config postgresql
There are 2 choices for the alternative postgresql (providing /usr/lib/postgresql).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/postgresql14 140 auto mode
1 /usr/lib/postgresql13 130 manual mode
2 /usr/lib/postgresql14 140 manual mode
Press <enter> to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/lib/postgresql13 to provide /usr/lib/postgresql (postgresql) in manual mode
alternatives --config postgresql
There are 2 choices for the alternative postgresql (providing /usr/lib/postgresql).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/postgresql14 140 auto mode
* 1 /usr/lib/postgresql13 130 manual mode
2 /usr/lib/postgresql14 140 manual mode
Press <enter> to keep the current choice[*], or type selection number:
Proposal
We currently have an rpm defined dependency on postresql13 and it's associated server and server-devel packages so rather than move all these dependency over the the newer, OS default, of 14, we should assert our system requirement via the alternative system. At least until we update our own client library of (from pyproject.toml):
psycopg2 = "==2.8.6" # last Python 2.7 version, PostgreSQL 13 errorcodes map?
This older dependency, that is questionable re Postgresql 13, should likely not be tried further with postgresql 14. In the context of our master and testing branches currently span Python 2.7 / 3.6.
This proposed postgresql alternatives assertion could be accomplished within a scriptlet, prior to our Poetry venv build, and post our new rpm/scriptlets install (which would have already installed our dependencies): e.g. %post.
Referenced: