Error: 42883 operator does not exist: extensions.vector <=> extensions.vector #23207
Replies: 3 comments 4 replies
-
I am facing the same issue here. So far only clue is this Reddit post that mentions Postgres 16 as the possible culprit. |
Beta Was this translation helpful? Give feedback.
-
Mine is a Postgres function and I finally got it working by adding:
so not sure how to translate that to the API, but maybe that can provide some hint. |
Beta Was this translation helpful? Give feedback.
-
@castortech had the correct solution some time ago. what i had hoped to contribute is an adaptation of his solution for people who cannot embed this code directly into their logic. log into the database as an administrator and run the following command: ALTER ROLE {user-name} IN DATABASE {database-name} SET search_path = {other-schemas}, extensions; (you just need to fill in the blanks for user-name, database-name, and other-schemas). i learned something similar to this in the book "Learn PostgreSQL second edition" and adapted it to @castortech's solution. the command to set the search_path is run each time the user connects to the database. therefore, all sorts of clients (JDBC, SQLAlchemy, etc.) can benefit from his solution. |
Beta Was this translation helpful? Give feedback.
-
Error: Operator does not exist in PostgreSQL (Supabase)
Description
When attempting a similarity search using the Supabase Vector Store in combination with Langchain, I encounter the following PostgreSQL error:
Error searching for documents: 42883 operator does not exist: extensions.vector <=> extensions.vector null
Steps to Reproduce
Enable the
pg_vector
extension and create a cosine similarity function in PostgreSQL.Disable RLS (Row Level Security) on the vector table.
Run a similarity search query using the following setup:
Query execution fails with the aforementioned error.
Actual Behavior
The process throws an SQL error regarding a missing operator in PostgreSQL, indicating that the vector comparison operator <=> is not recognized.
Additional Information
If someone could assist in resolving this missing operator issue or suggest alternative configurations, it would be greatly appreciated. Below is a snippet of the error stack for further debugging:
Beta Was this translation helpful? Give feedback.
All reactions