Which contribution?
core
What happened?
search_thoughts fails on every call with:
Search error: operator does not exist: extensions.vector <=> extensions.vector
capture_thought, list_thoughts, and thought_stats work normally.
Root cause: Supabase installs pgvector in the extensions schema on some project configurations. The match_thoughts function has search_path=public hardcoded, so it can't see the <=> operator from extensions.vector.
Confirmed via:
SELECT proname, proconfig FROM pg_proc WHERE proname = 'match_thoughts';
-- returns search_path=public
SELECT nspname, extname FROM pg_extension e JOIN pg_namespace n ON e.extnamespace = n.oid WHERE extname = 'vector';
-- returns extensions
What I tried
ALTER EXTENSION vector SET SCHEMA public — the error changes to type "extensions.vector" does not exist, suggesting the Edge Function or RPC call also has a hardcoded extensions.vector type reference. Reverting with ALTER EXTENSION vector SET SCHEMA extensions restores the original error state.
What did you expect?
Search_thoughts returns results. Possiblefix: set search_path=public,extensions on match_thoughts, or explicitly install pgvector in public during setup (CREATE EXTENSION vector SCHEMA public).
Steps to reproduce
- Create a new Supabase project (pgvector lands in
extensions schema by default on some configurations)
- Follow the standard OB1 setup — run the schema SQL, deploy the edge function
- Capture a few thoughts via capture_thought
- Call search_thoughts with any query
- Observe: operator does not exist: extensions.vector <=> extensions.vector
Environment
- Self-hosted OB1 on Supabase
- pgvector installed in
extensions schema (Supabase default on some project configurations)
Which contribution?
core
What happened?
search_thoughts fails on every call with:
Search error: operator does not exist: extensions.vector <=> extensions.vector
capture_thought, list_thoughts, and thought_stats work normally.
Root cause: Supabase installs pgvector in the
extensionsschema on some project configurations. The match_thoughts function has search_path=public hardcoded, so it can't see the <=> operator from extensions.vector.Confirmed via:
SELECT proname, proconfig FROM pg_proc WHERE proname = 'match_thoughts';
-- returns search_path=public
SELECT nspname, extname FROM pg_extension e JOIN pg_namespace n ON e.extnamespace = n.oid WHERE extname = 'vector';
-- returns extensions
What I tried
ALTER EXTENSION vector SET SCHEMA public— the error changes totype "extensions.vector" does not exist, suggesting the Edge Function or RPC call also has a hardcodedextensions.vectortype reference. Reverting withALTER EXTENSION vector SET SCHEMA extensionsrestores the original error state.What did you expect?
Search_thoughts returns results. Possiblefix: set search_path=public,extensions on match_thoughts, or explicitly install pgvector in public during setup (CREATE EXTENSION vector SCHEMA public).
Steps to reproduce
extensionsschema by default on some configurations)Environment
extensionsschema (Supabase default on some project configurations)