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:
(psycopg2.errors.UndefinedObject) type "vector" does not exist
LINE 4: embedding VECTOR(1536),
^
[SQL:
CREATE TABLE langchain_pg_embedding (
collection_id UUID,
embedding VECTOR(1536),
document VARCHAR,
cmetadata JSON,
custom_id VARCHAR,
uuid UUID NOT NULL,
PRIMARY KEY (uuid),
FOREIGN KEY(collection_id) REFERENCES langchain_pg_collection (uuid) ON DELETE CASCADE
)
]
My environment info:
List of installed extensions on postgres
Name | Version | Schema | Description
---------+---------+------------+--------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
vector | 0.4.1 | public | vector data type and ivfflat access method
I've tried the following ways to resolve:
- Fresh installing the Postgres docker image with pgvector extension enabled.
- Manually install the extension with the official instruction.
- Manually install the extension on Postgres like the following:
CREATE EXTENSION IF NOT EXISTS vector
SCHEMA public
VERSION "0.4.1";
But no luck.
"$user", public
in search path after runningSHOW search_path;
@Battlement – Eastbourne