Problem
PR #723 added inline ALTER TABLE statements in postgres_search_repository.py (lines ~324-360) that run at runtime during every vector sync initialization. These add entity_fingerprint and embedding_model columns to search_vector_chunks.
This causes deadlocks when two concurrent index jobs hit the same database — both try to ALTER TABLE simultaneously and Postgres detects the deadlock.
The alembic migration for these columns already exists: m6h7i8j9k0l1_add_vector_sync_fingerprints.py
Fix
Delete the inline DDL from postgres_search_repository.py. The alembic migration handles schema changes. Runtime code should never run ALTER TABLE.
File
src/basic_memory/repository/postgres_search_repository.py — remove the ALTER TABLE / ADD COLUMN IF NOT EXISTS block
Problem
PR #723 added inline
ALTER TABLEstatements inpostgres_search_repository.py(lines ~324-360) that run at runtime during every vector sync initialization. These addentity_fingerprintandembedding_modelcolumns tosearch_vector_chunks.This causes deadlocks when two concurrent index jobs hit the same database — both try to
ALTER TABLEsimultaneously and Postgres detects the deadlock.The alembic migration for these columns already exists:
m6h7i8j9k0l1_add_vector_sync_fingerprints.pyFix
Delete the inline DDL from
postgres_search_repository.py. The alembic migration handles schema changes. Runtime code should never run ALTER TABLE.File
src/basic_memory/repository/postgres_search_repository.py— remove the ALTER TABLE / ADD COLUMN IF NOT EXISTS block