Finding contrib modules on your system

One good way to check if you have contrib modules installed is to see if the pgbench program is available. That's one of the few contrib components that installs a full program, rather than just scripts you can use. Here's a UNIX example of checking for pgbench:

    $ pgbench -V
pgbench (PostgreSQL) 9.6

If you're using an RPM or DEB packaged version of PostgreSQL, as would be the case on many Linux systems, the optional postgresql-contrib package contains all of the contrib modules and their associated installer scripts. You may have to add that package using yum, apt-get, or a similar mechanism if it isn't installed already. On Solaris, the package is named SUNWpostgr-contrib.

If you're not sure where your system PostgreSQL contrib modules are installed, you can use a filesystem utility to search for them. The locate works well for this purpose on many UNIX-like systems, as does the find command. The file search utilities available on the Windows Start menu will work. A sample file you could look for is pg_buffercache.sql which will be used in the upcoming Chapter 5, Memory for Database Caching, on memory allocation. Here's where you might find the file on some of the platforms that PostgreSQL supports: