本文为您介绍云数据库 PostgreSQL 支持的插件相关信息。
插件概述
云数据库 PostgreSQL 支持多款开源和自研插件,通过插件能够提升实例运维易用性、查询和写入性能、分词查询、数据检索、数据增量迁移等各方面的能力。
使用插件
创建插件
创建插件时,当前 pg_tencentdb_superuser 会临时提权为 superuser,通过所有的权限检查。
PostgreSQL 的插件是在 database 之下进行管理的,不同 database 之间可创建不同的插件,并且无法互相使用。
如需创建插件,请通过客户端工具访问至数据库中,执行如下语句创建指定插件:
CREATE EXTENSION [ IF NOT EXISTS ] extension_name[ WITH ][ SCHEMA schema_name ][ VERSION version ][ FROM old_version ]
查看已创建的插件
当已经安装了部分插件,需要查看当前 database 安装的插件列表,可通过以下命令查看:
如使用 psql 客户端,可执行 \\dx 命令。
\\dxList of installed extensionsName | Version | Schema | Description---------------+---------+------------+---------------------------------------------------------------------amcheck | 1.2 | public | functions for verifying relation integritybloom | 1.0 | public | bloom access method - signature file based indexhstore | 1.6 | public | data type for storing sets of (key, value) pairshstore_plperl | 1.0 | public | transform between hstore and plperljsonb_plperl | 1.0 | public | transform between jsonb and plperlplperl | 1.0 | pg_catalog | PL/Perl procedural languageplpgsql | 1.0 | pg_catalog | PL/pgSQL procedural languagepostgis | 3.0.2 | public | PostGIS geometry, geography, and raster spatial types and functions(8 rows)
如需使用 SQL 查看,则可执行
select * from pg_available_extensions where installed_version is not null;
语句查看已安装的插件列表。name | default_version | installed_version | comment---------------+-----------------+-------------------+---------------------------------------------------------------------plperl | 1.0 | 1.0 | PL/Perl procedural languageamcheck | 1.2 | 1.2 | functions for verifying relation integrityhstore_plperl | 1.0 | 1.0 | transform between hstore and plperlplpgsql | 1.0 | 1.0 | PL/pgSQL procedural languagejsonb_plperl | 1.0 | 1.0 | transform between jsonb and plperlhstore | 1.6 | 1.6 | data type for storing sets of (key, value) pairsbloom | 1.0 | 1.0 | bloom access method - signature file based indexpostgis | 3.0.2 | 3.0.2 | PostGIS geometry, geography, and raster spatial types and functions(8 rows)