2

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

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

7

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.

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?
    – kevin
    Commented Sep 1, 2021 at 12:58
  • Thank you Verace. that is clear
    – kevin
    Commented Sep 1, 2021 at 14:01
0

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.

Your Answer

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

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