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

vllm : Failed to infer device type

android studio kotlin source is null error

gemini cli getting file not defined error