Skip to content

📚 PGVector enabled

🔍 Prepare:

## OS and Software environment:

Environment name Version
OS Rocky Linux 9.x
DB PostgreSQL 16.X

## introduction:

Store your vectors with the rest of your data. Supports: exact and approximate nearest neighbor search,single-precision, half-precision, binary, and sparse vectors L2 distance, inner product, cosine distance, L1 distance, Hamming distance, and Jaccard distance ,any language with a Postgres client,Plus ACID compliance, point-in-time recovery, JOINs, and all of the other great features of Postgres

### 1. Download Package

http_proxy="http://10.55.13.139:8080"
export http_proxy
https_proxy="http://10.55.13.139:8080"
export https_proxy

cat << EOF > /etc/yum.repos.d/pgdg_rocky-16.repo
[pgdg16]
name=PostgreSQL 16 for RHEL/CentOS
baseurl=https://download.postgresql.org/pub/repos/yum/16/redhat/rhel-\$releasever-\$basearch
enabled=1
gpgcheck=0
EOF

yum clean all
yum makecache
yum list |grep pgvector
yum install -y pgvector_16.x86_64

alt text

### 2. Modify permissions

chown -R postgres. /usr/pgsql-16/

alt text

### 3. Create pgvector Extension On postgres DB(If Other DB Need,Please Enter DB Execute)

su - postgres
psql -p 5432 -d postgres
CREATE EXTENSION "vector";

alt text