pg如何安装插件

以自带的插件,bloom插件为例
之前装过了,现在尝试删除
postgres=# drop extension bloom;
psql: ERROR: cannot drop extension bloom because other objects depend on it
DETAIL: index idxbloom_t2 depends on operator class int4_ops for access method bloom
index idx_t1 depends on operator class int4_ops for access method bloom
HINT: Use DROP … CASCADE to drop the dependent objects too.

以上说明bloom被引用了,可用用cascade的模式删除
postgres=# drop extension bloom cascade;
psql: NOTICE: drop cascades to 2 other objects
DETAIL: drop cascades to index idxbloom_t2
drop cascades to index idx_t1
DROP EXTENSION

接下来安装比较简单
postgres=# create extension
adminpack btree_gist dict_xsyn hstore isn pageinspect pg_prewarm pg_visibility tablefunc unaccent
amcheck citext earthdistance insert_username lo pg_buffercache pgrowlocks postgres_fdw tcn
autoinc cube file_fdw intagg ltree pgcrypto pg_stat_statements refint tsm_system_rows
btree_gin dict_int fuzzystrmatch intarray moddatetime pg_freespacemap pgstattuple seg tsm_system_time

直接create extension bloom即可
postgres=# create extension bloom;
CREATE EXTENSION

可以查询当前用了哪些插件

postgres-# \dx
List of installed extensions
Name|Version|Schema|Description
bloom|1.0|public|bloom access method - signature file based index
dblink|1.2|public|connect to other PostgreSQL databases from within a database
pg_trgm|1.4|public|text similarity measurement and index searching based on trigrams
plpgsql|1.0|pg_catalog|PL/pgSQL procedural language
(4 rows)

你可能感兴趣的:(PostgreSQL)