I'm looking to benchmark some custom PostgreSQL statements using pgbench but my problem with this is that upon trying to install pgbench it tries to install PostgreSQL server. The pgbench utility package is documented here

The machine in question is a production box (Ubuntu) and I have refrained from installing any extra libraries that are not needed.

Is there a way to only install pgbench without completely installing the PostgreSQL package which includes PostgreSQL server?

  • Just out of interest - why are you installing a benchmarking tool on a production box anyway? I would install it on a non-prod box and then point the test(s) at the (production?) server of my choice.
    – Vérace
    Commented Feb 9, 2018 at 12:59
  • @Vérace Well .. we are experiencing some latency in few SQL statement of ours. trying to replicate that on non-production box with pgbench does not yield much hence we wanted to be sure if this an issue only with the production or not. Commented Feb 9, 2018 at 13:17
  • But can't you install the pg_bench on some machine "lying around the place" and then point it at your prod box? I presume you'll be doing these tests out of hours and/or that you have a mirror?
    – Vérace
    Commented Feb 9, 2018 at 13:56
  • @Vérace Agreed Tested that too but nothing come through conclusive on that testing and we are constantly seeing high SQL timing(measure using custom script) on simple select query is ran from the production box. Commented Feb 9, 2018 at 15:17
  • OK - then provide your table structures, your problem query(s) and EXPLAIN ANALYZE for these queries here (perhaps a new question). A definition of "high SQL timing" would be helpful - one man's slow query is another man's dynamite! :-) Machine specs (RAM, CPU and disk config + networking) would be good also. I think that the last thing that you should do is install a benchmarking tool on a prod server - keep the tool on another machine.
    – Vérace
    Commented Feb 9, 2018 at 15:22

1 Answer 1


You can't install the pgbench utilty without installing some required packages. These can be seen in the link you provided in your question:

Package: postgresql-contrib-9.3 (9.3.21-0ubuntu0.14.04 and others) [security]

Each package that has a depends (red dot) in front of it, is required to install the package you are installing.

In your case the postgresql-contrib-9.3 package depends on:

  • libc6
  • libossp-uuid16
  • libpq5
  • libssl1.0.0
  • libxml2
  • libxslt1.1
  • postgresql-9.3
  • zlib1g

If you follow the packages you will find addtional dependencies. The postgesql-9.3 package for example depends on:

  • ...
  • postgesql-client-9.3
  • postgesql-common -...

This goes on and on until all the prerequisites are met, so that your desired package can be installed.

Your question

Is there a way to only install pgbench without completely installing the PostgreSQL package which includes PostgreSQL server?

My answer

No it is not possible to install the pgbench utility contained in the postgresql-contrib-9.3 package without installing additonal packages, because of the dependencies.

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.