-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(fdw): How to be compatible with new pgvector types #459
Labels
Comments
cutecutecat
changed the title
feat(fdw): How to be compatible with pgvector symbol
feat(fdw): How to be compatible with new pgvector types
Apr 8, 2024
FDW problemsAt step CREATE SERVER foreign_server
FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (host 'host.docker.internal', port '28816', dbname 'vectors', sslmode 'disable', use_remote_estimate 'true', extensions 'vector');
GRANT USAGE ON FOREIGN SERVER foreign_server TO local_user;
postgres=> EXPLAIN verbose select * from foreign_test ORDER BY embedding <-> '[0.40671515, 0.24202824, 0.37059402]' LIMIT 1;
QUERY PLAN
---------------------------------------------------------------------------------------------------
Limit (cost=4881.00..4881.00 rows=1 width=44)
Output: id, embedding, ((embedding <-> '[0.40671515,0.24202824,0.37059402]'::vector))
-> Sort (cost=4881.00..5131.00 rows=100000 width=44)
Output: id, embedding, ((embedding <-> '[0.40671515,0.24202824,0.37059402]'::vector))
Sort Key: ((foreign_test.embedding <-> '[0.40671515,0.24202824,0.37059402]'::vector))
-> Foreign Scan on public.foreign_test (cost=100.00..4381.00 rows=100000 width=44)
Output: id, embedding, (embedding <-> '[0.40671515,0.24202824,0.37059402]'::vector)
Remote SQL: SELECT id, embedding FROM public.test
postgres=> EXPLAIN verbose select * from foreign_test ORDER BY embedding <-> '[0.40671515, 0.24202824, 0.37059402]' LIMIT 1;
ERROR: operator does not exist: vectors.vector public.<-> unknown
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
CONTEXT: remote SQL command: EXPLAIN SELECT id, embedding FROM vectors.test ORDER BY (embedding OPERATOR(public.<->) '[0.40671515,0.24202824,0.37059402]') ASC NULLS LAST The remote operator should be
For example, in supabase, Alternatives
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pgvector/pgvector#508
For:
Possible Methods:
Hook / Rewrite--> Different name mapping will fail to push down to indexThe text was updated successfully, but these errors were encountered: