Type "vector" does not exist
Hello, I have an RPC function that matches two tables with vectors. It works perfectly on my local machine, but when I uploaded it to production, I get this error: type 'vector' does not exist. I use the SQL editor to test it, and from there it works great. Que puede ser?
21 Replies
Is your vector extension installed in extensions?

Seems like search path issue if it does not work from REST API but works from SQL editor.
Yes, it is installed and I already have the tables and embeddings. I have tested it fine.

The problem is that when I move my project to production, I get this, and locally it works fine but not in production:

Is your table in public schema?
You run your postgres function in the SQL editor and it works but with rpc from REST API it does not?
Yes, I have everything in the public schema; it only happens in production, not locally. I really don't understand why.

You keep saying production, I understand that. Trying to figure out what could be different... like search_path or not in extensions, or the table being accessed is in a custom schema not available to the API or in the added search path.
match_candidates_full is a postgres function?
Yeah

Can you show the function?
And all the tables accessed there are all in the public schema?
So far the similar issues online are vector not installed in extensions (which you show is correct) and the tables being in schemas that are not in the default search path.
sorry
?
What is this search_path?
maybe that's it
If your tables are in the public schema then they are in the search path or should be.

In API settings.
You might also try running your SQL editor call as impersonating authenticated user if that is how your rpc call is made.
https://github.com/supabase/supabase/issues/13337#issuecomment-2329785721
Let me see, thanks Gary, when I solve it I'll comment here anyway, thanks a lot and happy Friday :sunglaso:
Ok, I solved it, here is the error, the vector is not installed in the public schema.


I think the solution is supposed to be to add extensions to the search path for the API or set search_path for the function, not put the extension in public. But I don't use it.
Well anyway, now with this I know what's going on, thanks a lot bro