fix: temp table schema qualification in pgvector backend#36
Merged
Conversation
gkennos
approved these changes
Jul 2, 2026
gkennos
left a comment
Member
There was a problem hiding this comment.
as discussed - this is a pragmatic hot-fix until temp schema management can be thought through more fully - approving on the assumption that issues will be raise to track that larger concern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
apply_concept_filter_wherebuilt IN-subqueries using SQLAlchemyTableobjects with no explicit schema. Passing anyschema_translate_mapto the engine, these references becomeschema._knn_domsetc. before the query reached PostgreSQL. Temp tables live inpg_temp, so the lookup failed.Fix: replace the three
in_(select(KNN_*_CORE_TABLE.c.id))calls withtext()raw-SQL subqueries, which bypassschema_translate_mapand let PostgreSQL resolve the names through the session's implicitpg_tempsearch-path prefix. The_TEMP_FILTER_METADATAandKNN_*_CORE_TABLEconstants are removed as they are no longer used.The
KNN_*_TABLEstring constants are kept sosetup_concept_filter_temps(DDL) andapply_concept_filter_where(DML) stay in sync by name. SQLite is unaffected, as unqualified names intext()are resolved through SQLite's owntempschema.pgvectorbackend raisesUndefinedTablefor temp filter tables whenschema_translate_mapis active #35