Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qRCss-000u1v-Ss for pgsql-general@arkaria.postgresql.org; Wed, 02 Aug 2023 14:31:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qRCsp-005YCA-Ar for pgsql-general@arkaria.postgresql.org; Wed, 02 Aug 2023 14:31:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qRCso-005YC2-Lb for pgsql-general@lists.postgresql.org; Wed, 02 Aug 2023 14:31:27 +0000 Received: from mrw-1.mail.tiscali.it ([195.130.225.201]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qRCsg-0008yp-HH for pgsql-general@postgresql.org; Wed, 02 Aug 2023 14:31:25 +0000 Received: from [10.39.80.29] by mrw-1 with esmtp (Exim) id 1qRCse-00640k-0A; Wed, 02 Aug 2023 14:31:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tiscali.it; s=mail; h=Message-ID:Subject:To:From:Date:Content-Type:MIME-Version:Sender: Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=7sljKpGaU1CRo+TQW18e40Hb9zgOhZq99Ow0aZ9zvss=; b=ld2DSafgSWRJxMvyjRoBU+JdHg SSiVl2lZy75iPR+y0D/hiLbnQm8+vbpLpZ9bxlCgCS24F6x5yGZyszLGDuCVwPeIO4EP1X8uFpzBw qD+ZjQ++ctaGC7TXZS3/jH1w2tPh/md0iRzGU74LaYssc4ZdPAnqPGJYpClQlmoIMi3U=; Received: from rc-13.mc.tiscali.sys ([10.39.75.133]:58470 helo=mail.tiscali.it) by mrl-1.mail.tiscali.sys with esmtp (Exim 4.89) (envelope-from ) id 1qRCsb-00H4tW-Ht for pgsql-general@postgresql.org; Wed, 02 Aug 2023 14:31:13 +0000 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_f32a4a60d2ffa0bca720ff7aade6126d" Date: Wed, 02 Aug 2023 16:31:12 +0200 From: marco.ptz@tiscali.it To: Subject: Different releases in the same server Message-ID: <7229c9037c2b263c23b4a9d48d7732a2@tiscali.it> X-Sender: marco.ptz@tiscali.it X-Originating-IP: 151.56.1.160 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=_f32a4a60d2ffa0bca720ff7aade6126d Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=UTF-8 Hi all, we have recently started to manage a production server running a 9.6 postgres. [root@xx ~]# cat /etc/os-release NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/" CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7" We have to upgrade to postgres 12.x but we have a few questions due the configuration found in the server. Basically there are 3 different release present, 9.2, 9.6 ( running ), 12 (future upgrade target release): [root@xx ~]# yum list installed | grep postgres Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast postgresql.x86_64 9.2.24-4.el7_8 @base/7.9.2009 postgresql-libs.x86_64 9.2.24-4.el7_8 @base/7.9.2009 postgresql12.x86_64 12.14-1PGDG.rhel7 @pgdg12 postgresql12-libs.x86_64 12.14-1PGDG.rhel7 @pgdg12 postgresql12-server.x86_64 12.14-1PGDG.rhel7 @pgdg12 postgresql96.x86_64 9.6.11-1PGDG.rhel7 @pgdg96 postgresql96-contrib.x86_64 9.6.11-1PGDG.rhel7 @pgdg96 postgresql96-libs.x86_64 9.6.11-1PGDG.rhel7 @pgdg96 postgresql96-server.x86_64 9.6.11-1PGDG.rhel7 @pgdg96 the running version is 9.6 [root@xx ~]# ps -ef| grep D UID PID PPID C STIME TTY TIME CMD postgres 1436 1 0 Apr18 ? 06:56:14 /usr/pgsql-9.6/bin/postmaster -D /var/lib/pgsql/9.6/data/ in the server is also installed the alternatives packages which is configured that way: [root@xx ~]# alternatives --list libnssckbi.so.x86_64 auto /usr/lib64/pkcs11/p11-kit-trust.so ld auto /usr/bin/ld.bfd mta manual /usr/sbin/sendmail.sendmail pgsql-ld-conf auto /usr/pgsql-12/share/postgresql-12-libs.conf pgsql-psql auto /usr/pgsql-12/bin/psql pgsql-clusterdb auto /usr/pgsql-12/bin/clusterdb pgsql-createdb auto /usr/pgsql-12/bin/createdb pgsql-createlang auto /usr/pgsql-9.6/bin/createlang pgsql-createuser auto /usr/pgsql-12/bin/createuser pgsql-dropdb auto /usr/pgsql-12/bin/dropdb pgsql-droplang auto /usr/pgsql-9.6/bin/droplang pgsql-dropuser auto /usr/pgsql-12/bin/dropuser pgsql-pg_basebackup auto /usr/pgsql-12/bin/pg_basebackup pgsql-pg_dump auto /usr/pgsql-12/bin/pg_dump pgsql-pg_dumpall auto /usr/pgsql-12/bin/pg_dumpall pgsql-pg_restore auto /usr/pgsql-12/bin/pg_restore pgsql-reindexdb auto /usr/pgsql-12/bin/reindexdb pgsql-vacuumdb auto /usr/pgsql-12/bin/vacuumdb pgsql-clusterdbman auto /usr/pgsql-12/share/man/man1/clusterdb.1 pgsql-createdbman auto /usr/pgsql-12/share/man/man1/createdb.1 pgsql-createlangman auto /usr/pgsql-9.6/share/man/man1/createlang.1 pgsql-createuserman auto /usr/pgsql-12/share/man/man1/createuser.1 pgsql-dropdbman auto /usr/pgsql-12/share/man/man1/dropdb.1 pgsql-droplangman auto /usr/pgsql-9.6/share/man/man1/droplang.1 pgsql-dropuserman auto /usr/pgsql-12/share/man/man1/dropuser.1 pgsql-pg_basebackupman auto /usr/pgsql-12/share/man/man1/pg_basebackup.1 pgsql-pg_dumpman auto /usr/pgsql-12/share/man/man1/pg_dump.1 pgsql-pg_dumpallman auto /usr/pgsql-12/share/man/man1/pg_dumpall.1 pgsql-pg_restoreman auto /usr/pgsql-12/share/man/man1/pg_restore.1 pgsql-psqlman auto /usr/pgsql-12/share/man/man1/psql.1 pgsql-reindexdbman auto /usr/pgsql-12/share/man/man1/reindexdb.1 pgsql-vacuumdbman auto /usr/pgsql-12/share/man/man1/vacuumdb.1 postgis-pgsql2shp auto /usr/pgsql-9.6/bin/pgsql2shp postgis-shp2pgsql auto /usr/pgsql-9.6/bin/shp2pgsql As far as I know, alternatives package uses path /etc/alternatives/ and create links from /usr/bin to /etc/alternatives which in turn links to the binaries to the correct selected version (/usr/pgsql-9.6/bin OR /usr/pgsql-12/bin). We have checked the current alternatives configuration, and it knows only about 9.6 and 12 relases: [root@xx ~]# alternatives --display pgsql-psql pgsql-psql - status is auto. link currently points to /usr/pgsql-12/bin/psql /usr/pgsql-9.6/bin/psql - priority 960 /usr/pgsql-12/bin/psql - priority 1200 Current `best' version is /usr/pgsql-12/bin/psql. At present in /usr/bin there are not links as aspected for use with alternatives, but there are files belonging to 9.2 version except for pg_basebackup: [root@xx ~]# ls -l /usr/bin/p* lrwxrwxrwx. 1 root root 37 Apr 30 08:05 /usr/bin/pg_basebackup -> /etc/alternatives/pgsql-pg_basebackup -rwxr-xr-x. 1 root root 28672 May 12 2020 /usr/bin/pg_config -rwxr-xr-x. 1 root root 313120 May 12 2020 /usr/bin/pg_dump -rwxr-xr-x. 1 root root 75672 May 12 2020 /usr/bin/pg_dumpall -rwxr-xr-x. 1 root root 129872 May 12 2020 /usr/bin/pg_restore -rwxr-xr-x. 1 root root 449272 May 12 2020 /usr/bin/psql [root@xx ~]# /usr/bin/psql --version psql (PostgreSQL) 9.2.24 [root@xx ~]# /usr/bin/pg_dump --version pg_dump (PostgreSQL) 9.2.24 we have checked whit rpm and it seems that the 9.2 package is the only one that put files in /usr/bin: relase 9.2 [root@xx local]# rpm -ql postgresql.x86_64 /usr/bin/clusterdb /usr/bin/createdb /usr/bin/createlang /usr/bin/createuser /usr/bin/dropdb /usr/bin/droplang /usr/bin/dropuser /usr/bin/pg_config /usr/bin/pg_dump /usr/bin/pg_dumpall /usr/bin/pg_restore /usr/bin/psql /usr/bin/reindexdb /usr/bin/vacuumdb /usr/lib64/pgsql release 9.6 [root@xx local]# rpm -ql postgresql96-server.x86_64 /etc/pam.d/postgresql /etc/sysconfig/pgsql /usr/lib/systemd/system/postgresql-9.6.service /usr/lib/tmpfiles.d/postgresql-9.6.conf /usr/pgsql-9.6/bin/initdb /usr/pgsql-9.6/bin/pg_controldata /usr/pgsql-9.6/bin/pg_ctl /usr/pgsql-9.6/bin/pg_resetxlog /usr/pgsql-9.6/bin/postgres /usr/pgsql-9.6/bin/postgresql96-check-db-dir /usr/pgsql-9.6/bin/postgresql96-setup /usr/pgsql-9.6/bin/postmaster release 12 [root@xx local]# rpm -ql postgresql12-server.x86_64 /etc/pam.d/postgresql /etc/sysconfig/pgsql /usr/bin/postgresql-12-setup /usr/lib/systemd/system/postgresql-12.service /usr/lib/tmpfiles.d/postgresql-12.conf /usr/pgsql-12/bin/initdb /usr/pgsql-12/bin/pg_checksums /usr/pgsql-12/bin/pg_controldata /usr/pgsql-12/bin/pg_ctl /usr/pgsql-12/bin/pg_resetwal /usr/pgsql-12/bin/postgres /usr/pgsql-12/bin/postgresql-12-check-db-dir /usr/pgsql-12/bin/postgresql-12-setup /usr/pgsql-12/bin/postmaster Of course we will try to test in a VM created as a clone of the producion to verify any step (it is not our own server). the quesions are: Could we have trouble having 9.6 and 12 running in the same time (we will upgrade with pg_upgrade) in such server? HOW can we to fix the presence of release 9.2 files in /usr/bin? Will the simbolic links in /usr/bin be created by alternatives once the 9.2 release will be dropped/deinstalled/deleted? Any suggestion is welcome Thanks in advance regards Marco --=_f32a4a60d2ffa0bca720ff7aade6126d Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=UTF-8
Hi all,
we have recently started to manage a production server ru= nning a 9.6 postgres.

[root@xx ~]# cat /etc/os-release
NAME= =3D"CentOS Linux"
VERSION=3D"7 (Core)"
ID=3D"centos"
ID_LIKE= =3D"rhel fedora"
VERSION_ID=3D"7"
PRETTY_NAME=3D"CentOS Linux 7 (= Core)"
ANSI_COLOR=3D"0;31"
CPE_NAME=3D"cpe:/o:centos:centos:7"HOME_URL=3D"https://www.centos.org/"
BUG_REPORT_URL=3D"https://bugs= =2Ecentos.org/"

CENTOS_MANTISBT_PROJECT=3D"CentOS-7"
CENTOS= _MANTISBT_PROJECT_VERSION=3D"7"
REDHAT_SUPPORT_PRODUCT=3D"centos"
REDHAT_SUPPORT_PRODUCT_VERSION=3D"7"

We have to upgrade to post= gres 12.x but we have a few questions due the configuration found in the se= rver.
Basically there are 3 different release present, 9.2, 9.6 ( runn= ing ), 12 (future upgrade target release):


[root@xx ~]# yu= m list installed | grep postgres
Repodata is over 2 weeks old. Install= yum-cron? Or run: yum makecache fast
postgresql.x86_64 = 9.2.24-4.el7_8 @base/7.9.2009
postgresql-libs.x86_64 = 9.2.24-4.el7_8 @base/7.9.2009
postgresql12.x86= _64 12.14-1PGDG.rhel7 @pgdg12
postgresql= 12-libs.x86_64 12.14-1PGDG.rhel7 @pgdg12
post= gresql12-server.x86_64 12.14-1PGDG.rhel7 @pgdg12
postgresql96.x86_64 9.6.11-1PGDG.rhel7 @pgdg96 =
postgresql96-contrib.x86_64 9.6.11-1PGDG.rhel7 @pgd= g96
postgresql96-libs.x86_64 9.6.11-1PGDG.rhel7 = @pgdg96
postgresql96-server.x86_64 9.6.11-1PGDG.rhel= 7 @pgdg96

the running version is 9.6

[root@= xx ~]# ps -ef| grep D
UID PID PPID C STIME TTY TIME = CMD
postgres 1436 1 0 Apr18 ? 06:56:14 /usr/pgsql-9.6/bin= /postmaster -D /var/lib/pgsql/9.6/data/

in the server is also in= stalled the alternatives packages which is configured that way:

=
[root@xx ~]# alternatives --list
libnssckbi.so.x86_64 auto = /usr/lib64/pkcs11/p11-kit-trust.so
ld auto /usr/bin/ld.bfdmta manual /usr/sbin/sendmail.sendmail
pgsql-ld-conf auto = /usr/pgsql-12/share/postgresql-12-libs.conf
pgsql-psql auto /= usr/pgsql-12/bin/psql
pgsql-clusterdb auto /usr/pgsql-12/bin/cluste= rdb
pgsql-createdb auto /usr/pgsql-12/bin/createdb
pgsql-crea= telang auto /usr/pgsql-9.6/bin/createlang
pgsql-createuser = auto /usr/pgsql-12/bin/createuser
pgsql-dropdb auto /us= r/pgsql-12/bin/dropdb
pgsql-droplang auto /usr/pgsql-9.6/bin/dropl= ang
pgsql-dropuser auto /usr/pgsql-12/bin/dropuser
pgsql-pg_b= asebackup auto /usr/pgsql-12/bin/pg_basebackup
pgsql-pg_dump = auto /usr/pgsql-12/bin/pg_dump
pgsql-pg_dumpall auto /usr= /pgsql-12/bin/pg_dumpall
pgsql-pg_restore auto /usr/pgsql-12= /bin/pg_restore
pgsql-reindexdb auto /usr/pgsql-12/bin/reindexdbpgsql-vacuumdb auto /usr/pgsql-12/bin/vacuumdb
pgsql-clusterdbm= an auto /usr/pgsql-12/share/man/man1/clusterdb.1
pgsql-created= bman auto /usr/pgsql-12/share/man/man1/createdb.1
pgsql-creat= elangman auto /usr/pgsql-9.6/share/man/man1/createlang.1
pgsql-= createuserman auto /usr/pgsql-12/share/man/man1/createuser.1
pg= sql-dropdbman auto /usr/pgsql-12/share/man/man1/dropdb.1
pgsql-drop= langman auto /usr/pgsql-9.6/share/man/man1/droplang.1
pgsql-d= ropuserman auto /usr/pgsql-12/share/man/man1/dropuser.1
pgsql= -pg_basebackupman auto /usr/pgsql-12/share/man/man1/pg_basebackup.1
pgsql-pg_dumpman auto /usr/pgsql-12/share/man/man1/pg_dump.1pgsql-pg_dumpallman auto /usr/pgsql-12/share/man/man1/pg_dumpall= =2E1
pgsql-pg_restoreman auto /usr/pgsql-12/share/man/man1/pg_r= estore.1
pgsql-psqlman auto /usr/pgsql-12/share/man/man1/psql.1pgsql-reindexdbman auto /usr/pgsql-12/share/man/man1/reindexdb= =2E1
pgsql-vacuumdbman auto /usr/pgsql-12/share/man/man1/vacu= umdb.1
postgis-pgsql2shp auto /usr/pgsql-9.6/bin/pgsql2shppostgis-shp2pgsql auto /usr/pgsql-9.6/bin/shp2pgsql

=
As far as I know, alternatives package uses path /etc/alternatives/ a= nd create links from /usr/bin to /etc/alternatives
which in turn link= s to the binaries to the correct selected version (/usr/pgsql-9.6/bin OR /u= sr/pgsql-12/bin).
We have checked the current alternatives configurati= on, and it knows only about 9.6 and 12 relases:

[root@xx ~]# alt= ernatives --display pgsql-psql
pgsql-psql - status is auto.
link= currently points to /usr/pgsql-12/bin/psql
/usr/pgsql-9.6/bin/psql - = priority 960
/usr/pgsql-12/bin/psql - priority 1200
Current `best= ' version is /usr/pgsql-12/bin/psql.


At present in /usr/bi= n there are not links as aspected for use with alternatives, but there are = files belonging to
9.2 version except for pg_basebackup:

[r= oot@xx ~]# ls -l /usr/bin/p*
lrwxrwxrwx. 1 root root 37 Apr 30 08:= 05 /usr/bin/pg_basebackup -> /etc/alternatives/pgsql-pg_basebackup
= -rwxr-xr-x. 1 root root 28672 May 12 2020 /usr/bin/pg_config
-rwxr-x= r-x. 1 root root 313120 May 12 2020 /usr/bin/pg_dump
-rwxr-xr-x. 1 ro= ot root 75672 May 12 2020 /usr/bin/pg_dumpall
-rwxr-xr-x. 1 root roo= t 129872 May 12 2020 /usr/bin/pg_restore
-rwxr-xr-x. 1 root root 4492= 72 May 12 2020 /usr/bin/psql


[root@xx ~]# /usr/bin/psql -= -version
psql (PostgreSQL) 9.2.24
[root@xx ~]# /usr/bin/pg_dump -= -version
pg_dump (PostgreSQL) 9.2.24


we have checked = whit rpm and it seems that the 9.2 package is the only one that put files i= n /usr/bin:


relase 9.2
[root@xx local]# rpm -ql postg= resql.x86_64
/usr/bin/clusterdb
/usr/bin/createdb
/usr/bin/c= reatelang
/usr/bin/createuser
/usr/bin/dropdb
/usr/bin/dropl= ang
/usr/bin/dropuser
/usr/bin/pg_config
/usr/bin/pg_dump/usr/bin/pg_dumpall
/usr/bin/pg_restore
/usr/bin/psql
/us= r/bin/reindexdb
/usr/bin/vacuumdb
/usr/lib64/pgsql

rel= ease 9.6
[root@xx local]# rpm -ql postgresql96-server.x86_64
/etc= /pam.d/postgresql
/etc/sysconfig/pgsql
/usr/lib/systemd/system/po= stgresql-9.6.service
/usr/lib/tmpfiles.d/postgresql-9.6.conf
/usr= /pgsql-9.6/bin/initdb
/usr/pgsql-9.6/bin/pg_controldata
/usr/pgsq= l-9.6/bin/pg_ctl
/usr/pgsql-9.6/bin/pg_resetxlog
/usr/pgsql-9.6/b= in/postgres
/usr/pgsql-9.6/bin/postgresql96-check-db-dir
/usr/pgs= ql-9.6/bin/postgresql96-setup
/usr/pgsql-9.6/bin/postmaster

release 12
[root@xx local]# rpm -ql postgresql12-server.x86_64
/= etc/pam.d/postgresql
/etc/sysconfig/pgsql
/usr/bin/postgresql-12-= setup
/usr/lib/systemd/system/postgresql-12.service
/usr/lib/tmpf= iles.d/postgresql-12.conf
/usr/pgsql-12/bin/initdb
/usr/pgsql-12/= bin/pg_checksums
/usr/pgsql-12/bin/pg_controldata
/usr/pgsql-12/b= in/pg_ctl
/usr/pgsql-12/bin/pg_resetwal
/usr/pgsql-12/bin/postgre= s
/usr/pgsql-12/bin/postgresql-12-check-db-dir
/usr/pgsql-12/bin/= postgresql-12-setup
/usr/pgsql-12/bin/postmaster

Of course = we will try to test in a VM created as a clone of the producion to verify a= ny step (it is not our own server).
the quesions are:

Could= we have trouble having 9.6 and 12 running in the same time (we will upgrad= e with pg_upgrade) in such server?
HOW can we to fix the presence of r= elease 9.2 files in /usr/bin?
Will the simbolic links in /usr/bin be c= reated by alternatives once the 9.2 release will be dropped/deinstalled/del= eted?

Any suggestion is welcome
Thanks in advance

regards
Marco

--=_f32a4a60d2ffa0bca720ff7aade6126d--