List installed PostgreSQL extensions with version

May 1, 2021  ‐ 1 min read

With extensions you can add some extra functionality to your PostgreSQL database server. Which is a great but you generally don't want to have lots of extensions around which you are not using anymore. Therefore it is useful to clean them up once every while. To list the installed PostgreSQL extensions you need to run a SQL statement. For this you can login to the Postgres shell.

Now, to show the installed PostgreSQL extensions with their version numbers you run the following SQL query:

postgres=# SELECT name, default_version, installed_version FROM pg_available_extensions WHERE installed_version IS NOT NULL;
  name   | default_version | installed_version
 plpgsql | 1.0             | 1.0
 postgis | 2.1.3           | 2.1.3
(2 row)