How do I list all extensions that are already installed in a database or schema from psql?
See also
How do I list all extensions that are already installed in a database or schema from psql?
See also
In psql that would be
\dx
See the manual of psql for details.
Doing it in plain SQL it would be a select on pg_extension
:
SELECT *
FROM pg_extension;
\dx
is a psql command which was introduced with 9.0 when the create extension
feature was released. So yes, you need to upgrade your psql
as well (you should always use the psql
version that matches your DB version)
Aug 25, 2014 at 13:00
select * from pg_extension
Additionally if you want to know which extensions are available on your server: SELECT * FROM pg_available_extensions
.
See pg_available_extensions
and pg_available_extension_versions
.
This SQL query gives output similar to \dx
:
SELECT e.extname AS "Name", e.extversion AS "Version", n.nspname AS "Schema", c.description AS "Description"
FROM pg_catalog.pg_extension e
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = e.extnamespace
LEFT JOIN pg_catalog.pg_description c ON c.objoid = e.oid AND c.classoid = 'pg_catalog.pg_extension'::pg_catalog.regclass
ORDER BY 1;
Thanks to https://blog.dbi-services.com/listing-the-extensions-available-in-postgresql/
\dx
) do \set ECHO_HIDDEN on
.
Dec 5, 2020 at 21:06
Just a comment that whether you run as suggested above, in psql either
\dx
or
select extname from pg_extension ;
Keep in mind that