如何从 psql 列出已安装在数据库或模式中的所有扩展?
也可以看看
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;
此外,如果您想知道您的服务器上有哪些扩展可用:SELECT * FROM pg_available_extensions
.
此 SQL 查询给出的输出类似于\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;
感谢https://blog.dbi-services.com/listing-the-extensions-available-in-postgresql/