这里说明云数据库 PostgreSQL 支持的插件相关信息。
一、插件概述
云数据库 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 命令。
\\dx List of installed extensions Name | Version | Schema | Description —————+———+————+——————————————————————— amcheck | 1.2 | public | functions for verifying relation integrity bloom | 1.0 | public | bloom access method – signature file based index hstore | 1.6 | public | data type for storing sets of (key, value) pairs hstore_plperl | 1.0 | public | transform between hstore and plperl jsonb_plperl | 1.0 | public | transform between jsonb and plperl plperl | 1.0 | pg_catalog | PL/Perl procedural language plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language postgis | 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 language amcheck | 1.2 | 1.2 | functions for verifying relation integrity hstore_plperl | 1.0 | 1.0 | transform between hstore and plperl plpgsql | 1.0 | 1.0 | PL/pgSQL procedural language jsonb_plperl | 1.0 | 1.0 | transform between jsonb and plperl hstore | 1.6 | 1.6 | data type for storing sets of (key, value) pairs bloom | 1.0 | 1.0 | bloom access method – signature file based index postgis | 3.0.2 | 3.0.2 | PostGIS geometry, geography, and raster spatial types and functions(8 rows)
五、支持插件列表
云数据库 PostgreSQL 已支持多款功能强大、性能优秀的插件,各数据库版本详细支持插件列表请参见 支持插件列表。