5

I have a question regarding following output:

[nikola@192 ~] $ sudo su - postgres
[postgres@192 ~] $ psql dvdrental 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.7, server 11.8)
Type "help" for help.

dvdrental=# 

What do following two messages stand for and why? Messages I am asking about:

  1. psql: /usr/pgsql-11/lib/libpq.so.5: no version information available (required by psql)
  2. psql (11.7, server 11.8) - BTW, for this psql --version command I get following output: psql (PostgreSQL) 11.8 (had to install PostgreSQL Server version 11.7 in order to perform command such as \dt and \l) ...and also this output:
postgres=# select * FROM version();
                                                version                                                 
--------------------------------------------------------------------------------------------------------
 PostgreSQL 11.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2), 64-bit
(1 row)

P.S. I'm running PostgreSQL 11.8 on Fedora 30.

UPDATE1: As requested by @LaurenzAlbe output for rpm -qa|grep postgres command is:

[nikola@192 ~] $ rpm -qa|grep postgres
postgresql-11.7-2.fc30.x86_64
postgresql11-11.8-1PGDG.f30.x86_64
postgresql11-libs-11.8-1PGDG.f30.x86_64
postgresql11-server-11.8-1PGDG.f30.x86_64
postgresql-server-11.7-2.fc30.x86_64

UPDATE2:

I've ran dnf remove postgresql postgresql-server command -> databases are still there and I can access them via pgAdmin4 and psql: /usr/pgsql-11/lib/libpq.so.5: no version information available (required by psql message is no longer showing up. But, there is now new issue -> when I access postgres shell in terminal using sudo su - postgres command and then perform psql some-database-name postgres I get message

bash: psql: command not found...
Install package 'postgresql' to provide command 'psql'? [N/y]

I presume this is asking me to install AGAIN Fedora package which in 1st place I am trying to get rid off (to not show psql: /usr/pgsql-11/lib/libpq.so.5: no version information available (required by psql) message).

Any suggestion how to solve this without installing Fedora package but from PostgreSQL Global Development group?

P.S. BTW, I've installed Postgres server by following this link which uses PGDG packages (but something didn't work right on my machine and I guess I've been offered by Fedora30 OS to install Fedora packages which is obviously what I did :) ).

2
  • Could you add the result of this to the question: rpm -qa|grep postgres Jun 19, 2020 at 10:27
  • Hi Laurenz, I've updated my question as you asked. Please take a look
    – NikolaS
    Jun 19, 2020 at 12:02

5 Answers 5

9

You have installed a mixture of packets: some from the Fedora distribution, some from the PostgreSQL Global Development group.

These don't work well together. In particular, you have psql from the Fedora packages in the PATH, but libpq from the PGDG packages is on the library path.

That explains your question #2.

Ad question #1: that warning is printed if the library version of the installed library is lower than the one the software was linked with.

Remove the Fedora packages to get rid of the problem:

dnf remove postgresql postgresql-server

I hope that puts the correct psql on your PATH; if not, reinstall the postgresql11 package.

8
  • Will removing Fedora packages effect my pgAdmin4 configuration...I mean will I loose all my databases (if yes what should I do to save them -> only perform pg_dump for all databases for my postgresql cluster or something else)? Thank you in advance.
    – NikolaS
    Jun 19, 2020 at 13:03
  • 1
    Removing packages won't remove a database, but you should definitely figure out which software is running your database. That might require someone who knows something about PostgreSQL. Dumping the database and restoring it afterwards is the safe way. Jun 19, 2020 at 13:13
  • I will definitely backup my databases, but is there any command to execute in terminal in order to find out which software is running my database? BTW, I'm using Postgres as my primary database for projects used for my Master Thesis.
    – NikolaS
    Jun 19, 2020 at 14:52
  • The ps command will show that. Jun 19, 2020 at 14:53
  • 1
    To confirm the above, I had a mismatch between libpq which was installed from the PGDG packages and postgresql from the Fedora packages. I ran dnf remove postgresql postgresql-server which also removed libpq because it is is a dependency, then installed both with dnf install postgresql postgresql-server. I fired up the server, it detected the previous installation, and the error was gone. Aug 15, 2021 at 7:23
2

After experimenting and trying out suggestions made by @Laurenz Albe I've managed to reach solution.

Solution after performing mentioned steps in my question to do one more additional step which is to run sudo dnf reinstall pacakage_name (package_name is one of three below mentioned packages ) command for following packages:

[nikola@192 ~] $ rpm -qa|grep postgres
postgresql11-11.8-1PGDG.f30.x86_64
postgresql11-libs-11.8-1PGDG.f30.x86_64
postgresql11-server-11.8-1PGDG.f30.x86_64

After that everything works as it should.

1

UPDATE

This question has been answered so so this answer is intended to be a complement.

I found the same problem running postgres version 13 on CentOS 8. As pointed out before, libpq's version is mismatched and comes from a different repository.

#  dnf info --installed libpq* postgresql*
Installed Packages
Name         : libpq5
Version      : 14.2
Release      : 42PGDG.rhel8
Architecture : x86_64
Size         : 791 k
Source       : libpq5-14.2-42PGDG.rhel8.src.rpm
Repository   : @System
From repo    : pgdg-common
...
    
Name         : postgresql
Version      : 13.5
Release      : 1.module_el8.5.0+1062+8eba5f44
Architecture : x86_64
Size         : 5.5 M
Source       : postgresql-13.5-1.module_el8.5.0+1062+8eba5f44.src.rpm
Repository   : @System
From repo    : appstream
...
    
Name         : postgresql-server
Version      : 13.5
Release      : 1.module_el8.5.0+1062+8eba5f44
Architecture : x86_64
Size         : 22 M
Source       : postgresql-13.5-1.module_el8.5.0+1062+8eba5f44.src.rpm
Repository   : @System
From repo    : appstream
...

This problem was solved by uninstalling the library

# rpm -e --nodeps libpq5

Note: Using "dnf" will attempt to remove postgresql and postgresql-server (which may be fine in many cases) and we would need to install them again. By using "rpm" we don't touch them so we don't have to reinstall.

and finally installing the correct one.

# dnf install libpq-13.3-1.el8_4.x86_64

Now everything matches

#  dnf info --installed libpq* postgresql*
Installed Packages
Name         : libpq
Version      : 13.3
Release      : 1.el8_4
Architecture : x86_64
Size         : 720 k
Source       : libpq-13.3-1.el8_4.src.rpm
Repository   : @System
From repo    : appstream
...

Name         : postgresql
Version      : 13.5
Release      : 1.module_el8.5.0+1062+8eba5f44
Architecture : x86_64
Size         : 5.5 M
Source       : postgresql-13.5-1.module_el8.5.0+1062+8eba5f44.src.rpm
Repository   : @System
From repo    : appstream
...

Name         : postgresql-server
Version      : 13.5
Release      : 1.module_el8.5.0+1062+8eba5f44
Architecture : x86_64
Size         : 22 M
Source       : postgresql-13.5-1.module_el8.5.0+1062+8eba5f44.src.rpm
Repository   : @System
From repo    : appstream
....
0

Although this is a very old post and people have already answered(specifically Laurenz Albe). I followed what Laurenz Albe has mentioned and found that in my /etc/yum.repos.d there was a repo location from redhat linux which was again and again installing conflicting library. I just commented out all entries for postgres in yum repos and tried doing fresh install of postgresql-server after uninstalling as mentioned by Laurenz Albe. It helped me to do all compatible package install. The error was resolved.

-1

See interference between versions:

psql (11.7, server 11.8)

This can be due to module vs. pgdg installation (see link1 and link2 at the bottom).

2
  • 1
    I think this was covered in the existing answer? Aug 29, 2022 at 21:35
  • I don't see "module" and "pgdg" mentioned in the answer, imho they are important keywords Aug 31, 2022 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.