我想在Postgres 10.2中使用SPI extension,我在Homebrew中安装了它。然而,
CREATE EXTENSION spi;
失败
ERROR: could not open extension control file "/usr/local/share/postgresql/extension/spi.control": No such file or directory
查看extension
目录,我看到很多扩展,但不是SPI。 Postgres documentation mentions扩展名将驻留在发行版的contrib
目录中,然后您可以单独构建它们,但我似乎无法在任何地方找到此目录。知道如何获取和安装SPI模块吗?
答案 0 :(得分:2)
https://www.postgresql.org/docs/current/static/contrib-spi.html
下面描述的每组功能都作为a提供 可单独安装的扩展。
所以你检查并尝试:
t=# select * from pg_available_extensions where name in ('refint','timetravel','autoinc','insert_username','moddatetime');
name | default_version | installed_version | comment
-----------------+-----------------+-------------------+-------------------------------------------------------------
moddatetime | 1.0 | | functions for tracking last modification time
autoinc | 1.0 | | functions for autoincrementing fields
insert_username | 1.0 | | functions for tracking who changed a table
timetravel | 1.0 | | functions for implementing time travel
refint | 1.0 | | functions for implementing referential integrity (obsolete)
(5 rows)
t=# create extension refint ;
CREATE EXTENSION
t=# create extension timetravel;
CREATE EXTENSION
依旧......