-
Notifications
You must be signed in to change notification settings - Fork 18
Server
For simplicity sake I use Forge to manage many database. When done setting up a Database server Postgres v15.
You can run this recipe:
#!/bin/bash
# Define your database password and name here
DB_PASSWORD=""
DB_NAME=""
# Update package list
apt update
apt install postgresql-15-pgvector
export PGPASSWORD=$DB_PASSWORD && sudo -u postgres psql -d $DB_NAME -c "CREATE EXTENSION vector;"
echo "PostgreSQL and Vector installation complete"
If that does not work try:
The command sudo apt-get install postgresql-server-dev-15
is for installing the PostgreSQL development package, which includes header files and libraries necessary to compile PostgreSQL and extensions.
It doesn't install the pgvector
extension. pgvector
(as of my knowledge cutoff in September 2021) needs to be built from source and then installed.
Here's a recap on how to do that:
-
Install dependencies:
sudo apt-get install git gcc postgresql-server-dev-15 libpq-dev
-
Clone the
pgvector
repository and build the extension:git clone https://github.com/ankane/pgvector.git cd pgvector make sudo make install
After these steps, you should be able to find pgvector.control
and pgvector--*.sql
in the directory /usr/share/postgresql/15/extension/
, which are the files needed to install the pgvector
extension in a PostgreSQL database.
Finally, log into your PostgreSQL database and run the SQL command to enable the extension:
CREATE EXTENSION pgvector;