How To Install postgresql-contrib-9.6 on Debian 9

In this tutorial we learn how to install postgresql-contrib-9.6 on Debian 9. postgresql-contrib-9.6 is additional facilities for PostgreSQL

Introduction

In this tutorial we learn how to install postgresql-contrib-9.6 on Debian 9.

What is postgresql-contrib-9.6

postgresql-contrib-9.6 is:

The PostgreSQL contrib package provides several additional features for the PostgreSQL database. This version is built to work with the server package postgresql-9.6. contrib often serves as a testbed for features before they are adopted into PostgreSQL proper:

adminpack - File and log manipulation routines, used by pgAdmin btree_gist - B-Tree indexing using GiST (Generalised Search Tree) chkpass - An auto-encrypted password datatype cube - Multidimensional-cube datatype (GiST indexing example) dblink - Functions to return results from a remote database earthdistance - Operator for computing the distance (in miles) between two points on the earth’s surface fuzzystrmatch - Levenshtein, metaphone, and soundex fuzzy string matching hstore - Store (key, value) pairs intagg - Integer aggregator/enumerator _int - Index support for arrays of int4, using GiST (benchmark needs the libdbd-pg-perl package) isn - type extensions for ISBN, ISSN, ISMN, EAN13 product numbers lo - Large Object maintenance ltree - Tree-like data structures oid2name - Maps OIDs to table names pageinspect - Inspection of database pages passwordcheck - Simple password strength checker pg_buffercache - Real time queries on the shared buffer cache pg_freespacemap- Displays the contents of the free space map (FSM) pg_trgm - Determine the similarity of text based on trigram matching pg_standby - Create a warm stand-by server pgbench - TPC-B like benchmark pgcrypto - Cryptographic functions pgrowlocks - A function to return row locking information pgstattuple - Returns the percentage of dead tuples in a table; this indicates whether a vacuum is required. postgresql_fdw - foreign data wrapper for PostgreSQL seg - Confidence-interval datatype (GiST indexing example) sepgsql - mandatory access control (MAC) based on SELinux spi - PostgreSQL Server Programming Interface; 4 examples of its use: autoinc - A function for implementing AUTOINCREMENT/ IDENTITY insert_username - function for inserting user names moddatetime - Update modification timestamps refint - Functions for implementing referential integrity (foreign keys). Note that this is now superseded by built-in referential integrity. timetravel - Re-implements in user code the time travel feature that was removed in 6.3. tablefunc - examples of functions returning tables uuid-ossp - UUID generation functions vacuumlo - Remove orphaned large objects

PostgreSQL is an object-relational SQL database management system.

There are three methods to install postgresql-contrib-9.6 on Debian 9. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install postgresql-contrib-9.6 Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install postgresql-contrib-9.6 using apt-get by running the following command:

sudo apt-get -y install postgresql-contrib-9.6

Install postgresql-contrib-9.6 Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install postgresql-contrib-9.6 using apt by running the following command:

sudo apt -y install postgresql-contrib-9.6

Install postgresql-contrib-9.6 Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install postgresql-contrib-9.6 using aptitude by running the following command:

sudo aptitude -y install postgresql-contrib-9.6

How To Uninstall postgresql-contrib-9.6 on Debian 9

To uninstall only the postgresql-contrib-9.6 package we can use the following command:

sudo apt-get remove postgresql-contrib-9.6

Uninstall postgresql-contrib-9.6 And Its Dependencies

To uninstall postgresql-contrib-9.6 and its dependencies that are no longer needed by Debian 9, we can use the command below:

sudo apt-get -y autoremove postgresql-contrib-9.6

Remove postgresql-contrib-9.6 Configurations and Data

To remove postgresql-contrib-9.6 configuration and data from Debian 9 we can use the following command:

sudo apt-get -y purge postgresql-contrib-9.6

Remove postgresql-contrib-9.6 configuration, data, and all of its dependencies

We can use the following command to remove postgresql-contrib-9.6 configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge postgresql-contrib-9.6

Dependencies

postgresql-contrib-9.6 have the following dependencies:

References

Summary

In this tutorial we learn how to install postgresql-contrib-9.6 package on Debian 9 using different package management tools: apt, apt-get and aptitude.