How to do it…

  1. First, we list all the available extensions:
postgres=# \x onExpanded display is on.postgres=# SELECT *postgres-# FROM pg_available_extensionspostgres-# ORDER BY name;-[ RECORD 1 ]-----+--------------------------------------------------name              | adminpackdefault_version   | 1.0installed_version |comment           | administrative functions for PostgreSQL-[ RECORD 2 ]-----+--------------------------------------------------name              | pg_stat statementsdefault_version   | 1.5installed_version |comment           | track execution statistics of all SQL statements executed(...)

In particular, if the dblink extension is installed, then we see a record like this:

-[ RECORD 10 ]----+--------------------------------------------------name              | dblinkdefault_version | ...

Get PostgreSQL 10 Administration Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.