Sunday, 18 August 2019 09:06

PostgreSQL on Fedora 30

Written by http://blog.mclaughlinsoftware.com/2019/08/19/postgres-on-fedora-30/
Rate this item
(0 votes)

the root user:

rpm -Uvh https://yum.postgresql.org/11/fedora/fedora-30-x86_64/pgdg-fedora-repo-latest.noarch.rpm

rpm -Uvh https://yum.postgresql.org/11/fedora/fedora-30-x86_64/pgdg-fedora-repo-latest.noarch.rpm

Then, you install the PostgreSQL with this command as the root user:

dnf install postgresql11-server

dnf install postgresql11-server

After installing the PostreSQL Server I got a few errors with the symbolic links failing to resolve in the log files. Then, I realized they only failed to create symbolic links because the fresh installation deploys executables directly to the /usr/bin directory.

Display detailed console log

Retrieving https://yum.postgresql.org/11/fedora/fedora-30-x86_64/pgdg-fedora-repo-latest.noarch.rpmwarning: /var/tmp/rpm-tmp.MD4lRU: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEYVerifying... ################################# [100%]Preparing... ################################# [100%]Updating / installing... 1:pgdg-fedora-repo-42.0-4################################# [100%][root@localhost ~]# dnf install postgresql11-serverPostgreSQL 1130 - x86_64 215 kB/s |585 kB 00:02 PostgreSQL 1030 - x86_64 199 kB/s |541 kB 00:02 PostgreSQL 9.630 - x86_64 295 kB/s |515 kB 00:01 PostgreSQL 9.530 - x86_64 179 kB/s |495 kB 00:02 PostgreSQL 9.430 - x86_64 269 kB/s |469 kB 00:01 Last metadata expiration check: 0:00:01 ago on Mon 19 Aug 2019 02:25:56 AM MDT.Dependencies resolved.================================================================================================================== Package Architecture Version Repository Size==================================================================================================================Installing: postgresql11-server x86_64 11.5-1PGDG.f30 pgdg11 4.8 MInstalling dependencies: postgresql11 x86_64 11.5-1PGDG.f30 pgdg11 1.7 M postgresql11-libs x86_64 11.5-1PGDG.f30 pgdg11 374 k Transaction Summary==================================================================================================================Install 3 Packages Total download size: 6.9 MInstalled size: 32 MIs this ok [y/N]: yDownloading Packages:(1/3): postgresql11-libs-11.5-1PGDG.f30.x86_64.rpm 213 kB/s |374 kB 00:01 (2/3): postgresql11-11.5-1PGDG.f30.x86_64.rpm 698 kB/s |1.7 MB 00:02 (3/3): postgresql11-server-11.5-1PGDG.f30.x86_64.rpm 1.5 MB/s |4.8 MB 00:03 ------------------------------------------------------------------------------------------------------------------Total 2.2 MB/s |6.9 MB 00:03 warning: /var/cache/dnf/pgdg11-cde8ad453ae6cd5b/packages/postgresql11-11.5-1PGDG.f30.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEYPostgreSQL 1130 - x86_64 1.6 MB/s |1.7 kB 00:00 Importing GPG key 0x442DF0F8: Userid : "PostgreSQL RPM Building Project <This email address is being protected from spambots. You need JavaScript enabled to view it.>" Fingerprint: 68C9 E2B9 1A37 D136 FE74 D176 1F16 D2E1 442D F0F8 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDGIs this ok [y/N]: yKey imported successfullyRunning transaction checkTransaction check succeeded.Running transaction testTransaction test succeeded.Running transaction Preparing : 1/1 Installing : postgresql11-libs-11.5-1PGDG.f30.x86_64 1/3 Running scriptlet: postgresql11-libs-11.5-1PGDG.f30.x86_64 1/3 Installing : postgresql11-11.5-1PGDG.f30.x86_64 2/3 Running scriptlet: postgresql11-11.5-1PGDG.f30.x86_64 2/3 failed to link/usr/bin/psql ->/etc/alternatives/pgsql-psql: /usr/bin/psql exists and it is not a symlinkfailed to link/usr/bin/clusterdb ->/etc/alternatives/pgsql-clusterdb: /usr/bin/clusterdb exists and it is not a symlinkfailed to link/usr/bin/createdb ->/etc/alternatives/pgsql-createdb: /usr/bin/createdb exists and it is not a symlinkfailed to link/usr/bin/createuser ->/etc/alternatives/pgsql-createuser: /usr/bin/createuser exists and it is not a symlinkfailed to link/usr/bin/dropdb ->/etc/alternatives/pgsql-dropdb: /usr/bin/dropdb exists and it is not a symlinkfailed to link/usr/bin/dropuser ->/etc/alternatives/pgsql-dropuser: /usr/bin/dropuser exists and it is not a symlinkfailed to link/usr/bin/pg_dump ->/etc/alternatives/pgsql-pg_dump: /usr/bin/pg_dump exists and it is not a symlinkfailed to link/usr/bin/pg_dumpall ->/etc/alternatives/pgsql-pg_dumpall: /usr/bin/pg_dumpall exists and it is not a symlinkfailed to link/usr/bin/pg_restore ->/etc/alternatives/pgsql-pg_restore: /usr/bin/pg_restore exists and it is not a symlinkfailed to link/usr/bin/reindexdb ->/etc/alternatives/pgsql-reindexdb: /usr/bin/reindexdb exists and it is not a symlinkfailed to link/usr/bin/vacuumdb ->/etc/alternatives/pgsql-vacuumdb: /usr/bin/vacuumdb exists and it is not a symlink Running scriptlet: postgresql11-server-11.5-1PGDG.f30.x86_64 3/3 Installing : postgresql11-server-11.5-1PGDG.f30.x86_64 3/3 Running scriptlet: postgresql11-server-11.5-1PGDG.f30.x86_64 3/3 Verifying : postgresql11-11.5-1PGDG.f30.x86_64 1/3 Verifying : postgresql11-libs-11.5-1PGDG.f30.x86_64 2/3 Verifying : postgresql11-server-11.5-1PGDG.f30.x86_64 3/3 Installed: postgresql11-server-11.5-1PGDG.f30.x86_64 postgresql11-11.5-1PGDG.f30.x86_64 postgresql11-libs-11.5-1PGDG.f30.x86_64 Complete!

Retrieving https://yum.postgresql.org/11/fedora/fedora-30-x86_64/pgdg-fedora-repo-latest.noarch.rpm warning: /var/tmp/rpm-tmp.MD4lRU: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY Verifying... ################################# [100%] Preparing... ################################# [100%] Updating / installing... 1:pgdg-fedora-repo-42.0-4 ################################# [100%] [root@localhost ~]# dnf install postgresql11-server PostgreSQL 11 30 - x86_64 215 kB/s | 585 kB 00:02 PostgreSQL 10 30 - x86_64 199 kB/s | 541 kB 00:02 PostgreSQL 9.6 30 - x86_64 295 kB/s | 515 kB 00:01 PostgreSQL 9.5 30 - x86_64 179 kB/s | 495 kB 00:02 PostgreSQL 9.4 30 - x86_64 269 kB/s | 469 kB 00:01 Last metadata expiration check: 0:00:01 ago on Mon 19 Aug 2019 02:25:56 AM MDT. Dependencies resolved. ================================================================================================================== Package Architecture Version Repository Size ================================================================================================================== Installing: postgresql11-server x86_64 11.5-1PGDG.f30 pgdg11 4.8 M Installing dependencies: postgresql11 x86_64 11.5-1PGDG.f30 pgdg11 1.7 M postgresql11-libs x86_64 11.5-1PGDG.f30 pgdg11 374 k Transaction Summary ================================================================================================================== Install 3 Packages Total download size: 6.9 M Installed size: 32 M Is this ok [y/N]: y Downloading Packages: (1/3): postgresql11-libs-11.5-1PGDG.f30.x86_64.rpm 213 kB/s | 374 kB 00:01 (2/3): postgresql11-11.5-1PGDG.f30.x86_64.rpm 698 kB/s | 1.7 MB 00:02 (3/3): postgresql11-server-11.5-1PGDG.f30.x86_64.rpm 1.5 MB/s | 4.8 MB 00:03 ------------------------------------------------------------------------------------------------------------------ Total 2.2 MB/s | 6.9 MB 00:03 warning: /var/cache/dnf/pgdg11-cde8ad453ae6cd5b/packages/postgresql11-11.5-1PGDG.f30.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY PostgreSQL 11 30 - x86_64 1.6 MB/s | 1.7 kB 00:00 Importing GPG key 0x442DF0F8: Userid : "PostgreSQL RPM Building Project <pgsqlrpms-hackers@pgfoundry.org>" Fingerprint: 68C9 E2B9 1A37 D136 FE74 D176 1F16 D2E1 442D F0F8 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG Is this ok [y/N]: y Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : postgresql11-libs-11.5-1PGDG.f30.x86_64 1/3 Running scriptlet: postgresql11-libs-11.5-1PGDG.f30.x86_64 1/3 Installing : postgresql11-11.5-1PGDG.f30.x86_64 2/3 Running scriptlet: postgresql11-11.5-1PGDG.f30.x86_64 2/3 failed to link /usr/bin/psql -> /etc/alternatives/pgsql-psql: /usr/bin/psql exists and it is not a symlink failed to link /usr/bin/clusterdb -> /etc/alternatives/pgsql-clusterdb: /usr/bin/clusterdb exists and it is not a symlink failed to link /usr/bin/createdb -> /etc/alternatives/pgsql-createdb: /usr/bin/createdb exists and it is not a symlink failed to link /usr/bin/createuser -> /etc/alternatives/pgsql-createuser: /usr/bin/createuser exists and it is not a symlink failed to link /usr/bin/dropdb -> /etc/alternatives/pgsql-dropdb: /usr/bin/dropdb exists and it is not a symlink failed to link /usr/bin/dropuser -> /etc/alternatives/pgsql-dropuser: /usr/bin/dropuser exists and it is not a symlink failed to link /usr/bin/pg_dump -> /etc/alternatives/pgsql-pg_dump: /usr/bin/pg_dump exists and it is not a symlink failed to link /usr/bin/pg_dumpall -> /etc/alternatives/pgsql-pg_dumpall: /usr/bin/pg_dumpall exists and it is not a symlink failed to link /usr/bin/pg_restore -> /etc/alternatives/pgsql-pg_restore: /usr/bin/pg_restore exists and it is not a symlink failed to link /usr/bin/reindexdb -> /etc/alternatives/pgsql-reindexdb: /usr/bin/reindexdb exists and it is not a symlink failed to link /usr/bin/vacuumdb -> /etc/alternatives/pgsql-vacuumdb: /usr/bin/vacuumdb exists and it is not a symlink Running scriptlet: postgresql11-server-11.5-1PGDG.f30.x86_64 3/3 Installing : postgresql11-server-11.5-1PGDG.f30.x86_64 3/3 Running scriptlet: postgresql11-server-11.5-1PGDG.f30.x86_64 3/3 Verifying : postgresql11-11.5-1PGDG.f30.x86_64 1/3 Verifying : postgresql11-libs-11.5-1PGDG.f30.x86_64 2/3 Verifying : postgresql11-server-11.5-1PGDG.f30.x86_64 3/3 Installed: postgresql11-server-11.5-1PGDG.f30.x86_64 postgresql11-11.5-1PGDG.f30.x86_64 postgresql11-libs-11.5-1PGDG.f30.x86_64 Complete!

After installing the PostgreSQL Server 11, you need to initialize the database. You use the following command to initialize the database as the root user:

/usr/pgsql-11/bin/postgresql-11-setup initdb

/usr/pgsql-11/bin/postgresql-11-setup initdb

It should return the following:

Initializing database ... OK

Initializing database ... OK

The PostgreSQL Server 11 database installs in the /var/lib/pgsql/11/data directory. You can list the contents, which should mirror these:

drwx------. 5 postgres postgres 4096 Aug 19 02:45 basedrwx------. 2 postgres postgres 4096 Aug 19 02:45 globaldrwx------. 2 postgres postgres 4096 Aug 19 02:45 logdrwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_commit_tsdrwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_dynshmem-rw-------. 1 postgres postgres 4269 Aug 19 02:45 pg_hba.conf-rw-------. 1 postgres postgres 1636 Aug 19 02:45 pg_ident.confdrwx------. 4 postgres postgres 4096 Aug 19 02:45 pg_logicaldrwx------. 4 postgres postgres 4096 Aug 19 02:45 pg_multixactdrwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_notifydrwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_replslotdrwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_serialdrwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_snapshotsdrwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_statdrwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_stat_tmpdrwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_subtransdrwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_tblspcdrwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_twophase-rw-------. 1 postgres postgres 3 Aug 19 02:45 PG_VERSIONdrwx------. 3 postgres postgres 4096 Aug 19 02:45 pg_waldrwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_xact-rw-------. 1 postgres postgres 88 Aug 19 02:45 postgresql.auto.conf-rw-------. 1 postgres postgres 23895 Aug 19 02:45 postgresql.conf

drwx------. 5 postgres postgres 4096 Aug 19 02:45 base drwx------. 2 postgres postgres 4096 Aug 19 02:45 global drwx------. 2 postgres postgres 4096 Aug 19 02:45 log drwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_commit_ts drwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_dynshmem -rw-------. 1 postgres postgres 4269 Aug 19 02:45 pg_hba.conf -rw-------. 1 postgres postgres 1636 Aug 19 02:45 pg_ident.conf drwx------. 4 postgres postgres 4096 Aug 19 02:45 pg_logical drwx------. 4 postgres postgres 4096 Aug 19 02:45 pg_multixact drwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_notify drwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_replslot drwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_serial drwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_snapshots drwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_stat drwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_stat_tmp drwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_subtrans drwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_tblspc drwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_twophase -rw-------. 1 postgres postgres 3 Aug 19 02:45 PG_VERSION drwx------. 3 postgres postgres 4096 Aug 19 02:45 pg_wal drwx------. 2 postgres postgres 4096 Aug 19 02:45 pg_xact -rw-------. 1 postgres postgres 88 Aug 19 02:45 postgresql.auto.conf -rw-------. 1 postgres postgres 23895 Aug 19 02:45 postgresql.conf

You need to enable and start the postgresql-11.service with the following commands as the root user:

systemctl enable postgresql-11.servicesystemctl start postgresql-11.service

systemctl enable postgresql-11.service systemctl start postgresql-11.service

You can login to test the configuration, like this:

su - postgres -c"psql"

su - postgres -c "psql"

You will see something like this:

psql: /usr/pgsql-11/lib/libpq.so.5: no version information available (required by psql)psql: /usr/pgsql-11/lib/libpq.so.5: no version information available (required by psql)psql (11.4, server 11.5)Type "help"for help. postgres=#

psql: /usr/pgsql-11/lib/libpq.so.5: no version information available (required by psql) psql: /usr/pgsql-11/lib/libpq.so.5: no version information available (required by psql) psql (11.4, server 11.5) Type "help" for help. postgres=#

The error message appear to indicate there’s a bug (at least Bug #15798 is similar). Specifically, a missing function in the libya.so.5 library. Determining that impact will take some time and I will update this blog post when I resolve it.

Read 984 times

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.