4

I would like to install just the PostgreSQL client tool (psql) on RHEL on a container to connect to an Azure database for PostgreSQL server. Can you please point me step by step instructions on how to do the same?. I do not want to install the entire postgresql server

Vérace
31k9 gold badges73 silver badges86 bronze badges
asked Sep 1, 2021 at 9:21
1
  • Doesn't Azure have a howto for that? If not, are you sure an Azure database can be accessed from outside? Commented Sep 1, 2021 at 10:01

2 Answers 2

9

On RedHat, and compatible systems, in order to install just the client only, the command is:

sudo yum install postgresql 

or maybe dnf, but dnf may be Fedora? The above command installs only the client tools and their dependencies!

For a full-blown server install (should you require it in the future), the command is:

sudo yum install postgresql-server

You can back out either of the commands above by issuing the command:

sudo yum remove <package name>

i.e.

sudo yum remove postgresql 

to uninstall your PostgreSQL client tools.

You may wish to consider a GUI:

  • pgAdmin an Open Source "sister project" to the main server one, very much tailored to PostgreSQL. Feature complete, but a bit resource heavy. Although the same could be said of Java clients...

  • OmniDB I have not used it much, but have heard good things)

  • JDBC

    • SQuirreL SQL - used a bit and liked
    • DBeaver - used a very small bit - similar to SQuirreL SQL
  • Windows (if of interest to you for other machines/boot environments)

    • HeidiSQL - used a little, fine. Very "bright and breezy" - a light, pleasant touch to it, if you have a Windows desk- or lap-top.

Unless you have a compelling reason not to use pgAdmin, I'd go with that first but you may have your own toolkit.

answered Sep 1, 2021 at 10:12
2
  • thanks. But i do not want the complete postgres server. I just want the client tools(psql). is there a way to just install connecting tools to query remote postgresql server? Commented Sep 1, 2021 at 12:58
  • Thank you Verace. that is clear Commented Sep 1, 2021 at 14:01
1

Modern RHEL should have postgresql in a module.
If you need to install a spesific version you can use

dnf install @postgresql:VER/client
e.g. dnf install @postgresql:20/client

Sometimes it'll just be under postgresql with the server component split into postgresql-server

Check with dnf repoquery -l postgresql if you want to make sure.

answered Nov 1, 2023 at 15:32

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.