gpt4 book ai didi

postgresql - 如何在 Mac OSX 上使用 Homebrew 安装的 Postgres 中的扩展

转载 作者:行者123 更新时间:2023-11-29 12:53:07 26 4
gpt4 key购买 nike

我想使用 SPI extension在我用 Homebrew 安装的 Postgres 10.2 中。然而,

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 模块吗?

最佳答案

https://www.postgresql.org/docs/current/static/contrib-spi.html

Each of the groups of functions described below is provided as a separately-installable extension.

所以你检查并尝试:

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

等等……

关于postgresql - 如何在 Mac OSX 上使用 Homebrew 安装的 Postgres 中的扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49420738/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com