如何在PostgreSQL 9.1+中导入模块或安装扩展? [英] How do I import modules or install extensions in PostgreSQL 9.1+?
本文介绍了如何在PostgreSQL 9.1+中导入模块或安装扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
首先,如果您使用的不是9.1+,请参考此问题。 >
Firstly, if you're not using 9.1+, please refer to this question.
如何为PostgreSQL 9.1安装扩展?
How do I install an extension to PostgreSQL 9.1?
推荐答案
Postgrseql 9.1提供了一个新命令 创建扩展
。您应该使用它来安装模块。
Postgrseql 9.1 provides for a new command CREATE EXTENSION
. You should use it to install modules.
adminpack , auth_delay , auto_explain , btree_gin , btree_gist
, chkpass , citext , cube , dblink , dict_int
, dict_xsyn , dummy_seclabel , earthdistance , file_fdw , fuzzystrmatch
, hstore , intagg , intarray , isn , lo
, ltree , oid2name , pageinspect , passwordcheck , pg_archivecleanup
, pgbench , pg_buffercache , pgcrypto , pg_freespacemap , pgrowlocks
, pg_standby , pg_stat_statements , pgstattuple , pg_test_fsync , pg_trgm
, pg_upgrade , seg , sepgsql , spi , sslinfo , tablefunc
, test_parser , tsearch2 , unaccent , uuid-ossp , vacuumlo
, xml2
例如,如果您要安装 earthdistance
,只需使用以下命令:
If for instance you wanted to install earthdistance
, simply use this command:
CREATE EXTENSION earthdistance;
如果您要安装扩展名为连字符的扩展名,例如 uuid-ossp
,您需要将扩展名用双引号引起来:
If you wanted to install an extension with a hyphen in its name, like uuid-ossp
, you need to enclose the extension name in double quotes:
CREATE EXTENSION "uuid-ossp";
- 详细了解contrib,以及9.1中可用的模块。
- 在此了解新的扩展基础架构以及用于管理该扩展基础架构的SQL命令现在,您可以更多轻松卸载模块,请参见
DROP EXTENSION
。您还可以获得扩展名列表,并且基本支持版本号。 - Read more about contrib, and the modules available in 9.1.
- Read about the new extension infrastructure, and the SQL commands to manage it here You can now more easily uninstall a module, see
DROP EXTENSION
. You can also get an extension list, and there is basic support for version numbers.
这篇关于如何在PostgreSQL 9.1+中导入模块或安装扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文