ARTICLE DETAIL

资讯详情

深耕郑州网站建设与运营推广的一线实战洞察。

在 Windows 下为 PostgreSQL 安装 pgvector 插件

在 Windows 下为 PostgreSQL 安装 pgvector 插件

1、前往 https://github.com/pgvector/pgvector 下载源码

或命令拉取:git clone --branch v0.8.2 https://github.com/pgvector/pgvector.git

2、使用管理员身份运行“x64 Native Tools Command Prompt for VS”工具(需安装 Visual Studio 并添加“使用 C++ 的桌面开发”工作负荷)

3、切到刚刚下载的源码目录,示例

cd /d D:\Downloads\postgresql\pgvector-0.8.2

4、执行以下命令安装

set "PGROOT=C:\Program Files\PostgreSQL\18"
nmake /F Makefile.win
nmake /F Makefile.win install

5、连接到 PostgreSQL 数据库,在所需插件的数据库执行以下命令

CREATE EXTENSION vector;

6、结束。

返回列表