Skip to content

fix: initialize and migrate pgvector tables transactionally (#54) - #82

Open
spelech wants to merge 2 commits into
mainfrom
hotfix/issue-54-pgvector-initialization
Open

spelech wants to merge 2 commits into
mainfrom
hotfix/issue-54-pgvector-initialization

Conversation

@spelech

@spelech spelech commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Fixes #54.

Changes

  • Initialize and migrate the vector table and indexes in one transaction.
  • Use a null-safe relation lookup for fresh tables and actual SQLAlchemy binds for regclass queries.
  • Migrate legacy id primary keys to (collection_name, id) without hiding aborted transactions.
  • Fail explicitly instead of dropping populated shared tables on dimension mismatch; allow dimension changes after an explicit coordinated clear.

Verification

  • Native PostgreSQL regressions initially failed; native plus existing pgvector tests now pass: 40 passed.
  • Covers fresh and legacy tables, null legacy collections, migration rollback, shared-ID collection isolation, search, counts, scoped deletion and dimension safety.
  • Generated requirement inventory: 2 passed; release/link-integrity gate passed.
  • Combined backend regression run: 70 passed, 1 skipped.
  • With the companion readiness/cache/failure fixes: 2 full-profile checks passed using PostgreSQL metadata, pgvector, API-key authentication and text/scanned PDF ingestion, search, cache reuse, injected database write failure, rollback, retry and deletion.

Native tests use isolated schemas under TEST_POSTGRES_URL and a deterministic loopback embedding endpoint. No production data was modified. Full-suite and fresh-source-build acceptance are not claimed.

Steve Pelech and others added 2 commits October 28, 2026 09:59
Use bind-safe relation lookups, propagate initialization failures, and preserve populated shared tables on dimension mismatch. Add native PostgreSQL collection isolation and rollback regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

fix(pgvector): isolate documents by the configured collection name

1 participant