Skip to content

search_thoughts fails when pgvector is installed in extensions schema #319

@alcohen

Description

@alcohen

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

  1. Create a new Supabase project (pgvector lands in extensions schema by default on some configurations)
  2. Follow the standard OB1 setup — run the schema SQL, deploy the edge function
  3. Capture a few thoughts via capture_thought
  4. Call search_thoughts with any query
  5. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions