Skip to content

fix: Support pgvector under non-default schema#5970

Open
Anarion-zuo wants to merge 2 commits intofeast-dev:masterfrom
Anarion-zuo:aaronzuo/pg_search_path
Open

fix: Support pgvector under non-default schema#5970
Anarion-zuo wants to merge 2 commits intofeast-dev:masterfrom
Anarion-zuo:aaronzuo/pg_search_path

Conversation

@Anarion-zuo
Copy link

@Anarion-zuo Anarion-zuo commented Feb 14, 2026

What this PR does / why we need it:

Vector extension for postgres is almost always installed under the public schema by default. When the table's schema is not public, add public to search_path.

Which issue(s) this PR fixes:

Fixes #5814.

Misc

Steps to reproduce the issue with the pgvector example under examples/online_store/pgvector_tutorial. This PR resolve the following error.

  • Change db_schema in feature_store.yaml to a value other than 'public'.
  • Execute feast apply.
  • Execute python3 pgvector_example.py, and get the following error.
Performing similarity search for: 'wireless audio device with good sound'
Traceback (most recent call last):
  File "/Users/bytedance/Projects/feast/examples/online_store/pgvector_tutorial/pgvector_example.py", line 207, in <module>
    main()
  File "/Users/bytedance/Projects/feast/examples/online_store/pgvector_tutorial/pgvector_example.py", line 200, in main
    perform_similarity_search(store, "wireless audio device with good sound", top_k=3)
  File "/Users/bytedance/Projects/feast/examples/online_store/pgvector_tutorial/pgvector_example.py", line 136, in perform_similarity_search
    results = store.retrieve_online_documents(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bytedance/Projects/feast/sdk/python/feast/feature_store.py", line 2554, in retrieve_online_documents
    document_features = self._retrieve_from_online_store(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bytedance/Projects/feast/sdk/python/feast/feature_store.py", line 2785, in _retrieve_from_online_store
    documents = provider.retrieve_online_documents(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bytedance/Projects/feast/sdk/python/feast/infra/passthrough_provider.py", line 306, in retrieve_online_documents
    result = self.online_store.retrieve_online_documents(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bytedance/Projects/feast/sdk/python/feast/infra/online_stores/postgres_online_store/postgres.py", line 439, in retrieve_online_documents
    cur.execute(
  File "/Users/bytedance/Projects/feast/.venv/lib/python3.11/site-packages/psycopg/cursor.py", line 97, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedObject: type "vector" does not exist
LINE 7:                         vector_value <-> $1::vector as dista...

Open with Devin

@Anarion-zuo Anarion-zuo requested a review from a team as a code owner February 14, 2026 16:53
Signed-off-by: aaronzuo <[email protected]>
@Anarion-zuo Anarion-zuo force-pushed the aaronzuo/pg_search_path branch from eab2d4d to f89a3db Compare February 14, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PostgreSQL online store ignores database search_path, breaking extensions like pgvector

1 participant