Skip to content

Postgres: Installing a new extension

Installing a new extension

Warning! You probably shouldn't install extensions to nightly/stable database instances yourself. Installation of these extensions should be handled by the application instead. See this ticket: Adding pgcrypto to tms_fleet_nightly and stable DB (https://app.clickup.com/t/86bw6x0gj)

Installing PostgreSQL extensions should be a trivial task. Remember to take a backup just in case. 1. Login to the database that you want to install your extension to, for example tms_fleet_nightly 2. Check what extensions are already installed: 1. \dx

tms_fleet_nightly=> \dx
                 List of installed extensions
  Name   | Version |   Schema   |         Description          
---------+---------+------------+------------------------------
 plpgsql | 1.0     | pg_catalog | PL/pgSQL procedural language
(1 row)
3. If your extension is not yet installed, install it with this command: 1. CREATE EXTENSION IF NOT EXISTS pgcrypto;
tms_fleet_nightly=> CREATE EXTENSION IF NOT EXISTS pgcrypto;
CREATE EXTENSION
4. Verify that the extension you installed is now available: 1. \dx
tms_fleet_nightly=> \dx
                  List of installed extensions
   Name   | Version |   Schema   |         Description          
----------+---------+------------+------------------------------
 pgcrypto | 1.3     | public     | cryptographic functions
 plpgsql  | 1.0     | pg_catalog | PL/pgSQL procedural language
(2 rows)