Skip to content

fix(pgvector): skip HNSW index creation when index already exists#83

Merged
MAnders333 merged 1 commit into
mainfrom
fix/embedding-fetch-timeout
Jun 7, 2026
Merged

fix(pgvector): skip HNSW index creation when index already exists#83
MAnders333 merged 1 commit into
mainfrom
fix/embedding-fetch-timeout

Conversation

@MAnders333
Copy link
Copy Markdown
Owner

CREATE INDEX IF NOT EXISTS still requires table ownership and fails with 'must be owner of table' on managed Postgres (e.g. Cloud SQL) where the schema was bootstrapped by a different role. When the index exists from a prior run, we now skip the CREATE entirely by checking pg_class first.

This prevents ANN search from being unnecessarily disabled, which was causing activation to fall back to Path B (fetch-all).

CREATE INDEX IF NOT EXISTS still requires table ownership and fails with
'must be owner of table' on managed Postgres (e.g. Cloud SQL) where the
schema was bootstrapped by a different role. When the index exists from a
prior run, we now skip the CREATE entirely by checking pg_class first.

This prevents ANN search from being unnecessarily disabled, which was
causing activation to fall back to Path B (fetch-all).
@MAnders333 MAnders333 merged commit 6480890 into main Jun 7, 2026
2 checks passed
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.

1 participant