postgres creating vector column getting error pq: type "vector" does not exist

Bump into this error while trying to create a vector column. 

Resolution:- Enable vector extension by running the following in your sql studio or other client


CREATE EXTENSION vector;

CREATE TABLE documents (
    id SERIAL PRIMARY KEY,
    content TEXT,
    embedding vector(1536) -- OpenAI's ada-002 embedding size
);

And you will see that it executes successfully




Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20