postgreSQL install pgvector

组件地址:https://github.com/pgvector/pgvector

我的机器是MacOS,下载的postgreSQL是15,按理下载下来是自动安装了pgvector,但是测试的时候发现并没有这个extension。

按文档执行:

make -- 报错,clang: error: unsupported argument 'native' to option '-march=' 。

经查询命令改为:make OPTFLAGS=""

然后报错误:clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk' [-Wmissing-sysroot] 。重新安装了xcode command Line tools还是报这个错。应该是因为新版的command line tools本身就没有这个11.3.sdk文件,所以怎么更新都没用。

于是从:https://github.com/phracker/MacOSX-SDKs  下载了MacOSX11.3.sdk,放在本地/Library/Developer/CommandLineTools/SDKs/下。

重新执行:make OPTFLAGS="" 和 sudo make install 。成功。

 

Enable the extension (do this once in each database where you want to use it)

CREATE EXTENSION vector;
 

Create a vector column with 3 dimensions

CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3));

 

posted @   saaspeter  阅读(149)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
点击右上角即可分享
微信分享提示