94

Simple question, but no resources found about this. Is there any way to install only a PostgreSQL client, the terminal-based one, psql, on a CentOS7 system, without installing the complete PostgreSQL server? There is no dedicated postgresql-client or postgresql94-client or anything similar on the repositories.

2
  • A full postgres install comes down to 26 Mb on my system. If the daemon is not started, there is no reason why it would hurt to hgave some extra files around. Is there a particular reason why you do want to spare some extra megabytes?
    – joepd
    Dec 15, 2015 at 13:50
  • I didn't notice the comment early enough, sorry. Well, not really (except having the need to disable the daemon). Just call it OCD, I don't like surplus software laying around. Apr 12, 2016 at 7:56

3 Answers 3

114

I think the naming convention might simply be backwards from what you expect there: there's a package

postgresql-server The programs needed to create and run a PostgreSQL server

and a package

postgresql PostgreSQL client programs

(and postgresql does not have a dependency on postgresql-server, at least not in CentOS 6, though they both depend on a common postgresql-libs package).

3
  • 4
    On 64-bit red hat it will be postgresql.x86_64. The command to figure this out is login as root and run yum list | grep postgresql.
    – arun
    Sep 14, 2016 at 19:24
  • @arun: yes. (Once the OS is installed, you will automatically get the version matching your architecture, unless you explicitly ask for the .i686 or .x86_64) Sep 15, 2016 at 17:46
  • Same on Amazon linux. you can tell its correct because the server one uses it as a dependency.
    – Tony-Caffe
    Nov 16, 2021 at 21:24
4

In order to get the postgresql client in red hat or centos on ec2 instance, you have to install theses two pacakges: yum install -y postgresql-libs-9.2.24-1.amzn2.0.1.x86_64 postgresql-9.2.24-1.amzn2.0.1.x86_64

If these versions don't exist use this command to work out which versions you have:

yum list | grep postgres

And then issue the command with the two libraries you have access to, eg:

yum install -y postgresql96-libs.x86_64 postgresql96.x86_64
2

On CentOS 8 you can do the following to install the client:

dnf install postgresql

And if you need a server:

dnf install postgresql-server

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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