答案 0 :(得分:258)
在psql中将是
\dx
有关详细信息,请参阅手册:http://www.postgresql.org/docs/current/static/app-psql.html
在纯SQL中执行它,它将是pg_extension
上的选择:
SELECT *
FROM pg_extension
http://www.postgresql.org/docs/current/static/catalog-pg-extension.html
答案 1 :(得分:57)
此外,如果您想知道服务器上有哪些可用的扩展程序:SELECT * FROM pg_available_extensions
答案 2 :(得分:0)
此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/