Skip to main content

Postgres Vector Database

Postgres itself isn't a vector database, but the open-source pgvector extension lets it store and search vector data efficiently, like finding similar text embeddings.

Getting started with Postgres Vector DB

The pgvector extension enables you to store vector embeddings and perform vector similarity search in Postgres.To enable the extension follow the below steps,

  1. Check the vector extension is available using command (It's only available in newer versions)

    SHOW rds.extensions;
  2. Install it using

    CREATE EXTENSION vector;
  3. Verify using

    \dx

    (or)

    SELECT * FROM pg_extension;

Setting up the Postgres Vector DB in Unstract

Now that we have an API key from Qdrant, we can use it to set up a Vector DB profile on the Unstract platform. For this:

  • Sign in to the Unstract Platform

  • From the side navigation menu, choose Settings 🞂 Vector DBs

  • Click on the New Vector DB Profile button

  • From the list of supported Vector DBs, choose Postrges. You should see a dialog box where you enter details.

    img Postgres Vector DB Configuration

  • Postgres Connection string/URL is split in below format.

    • postgresql://[user]:[password]@][host]:[port]/[database name]
  • For Name, enter a name for this connector.

  • For Database, enter the Database name

  • For Host, enter the Host

  • For Port, enter the Port

  • For User, enter the username

  • For Password, enter the password