Mohamed Takki
Mohamed Takki

Reputation: 1

Type "vector" does not exist on postgresql - langchain/ postgresql

I was trying to embed some documents on postgresql with the help of pgvector extension and langchain. Unfortunately I'm having trouble with the following error:

that's my code langchain python :

from langchain_postgres.vectorstores import PGVector


CONNECTION_STRING = "postgresql+psycopg2://postgres:123@localhost:5432/vector_db"

COLLECTION_NAME = "state_of_doc_vectors"

db = PGVector.from_documents(embedding=embeddings, documents=documents, collection_name=COLLECTION_NAME, connection=CONNECTION_STRING)

Error :

FeatureNotSupported: ERREUR:  l'extension « vector » n'est pas disponible
DETAIL:  Could not open extension control file "C:/Program Files/PostgreSQL/16/share/extension/vector.control": No such file or directory.
HINT:  Les extensions doivent tout d'abord être installées sur le système où PostgreSQL est exécuté.

and when I execute command : CREATE EXTENSION vector

ERROR:  Could not open extension control file "C:/Program Files/PostgreSQL/16/share/extension/vector.control": No such file or directory.l'extension « vector » n'est pas disponible 

ERREUR:  l'extension « vector » n'est pas disponible
SQL state: 0A000
Detail: Could not open extension control file "C:/Program Files/PostgreSQL/16/share/extension/vector.control": No such file or directory.

Upvotes: 0

Views: 131

Answers (0)

Related Questions