From: juchiast (@juchiast) <noreply+juchiast@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: [pgvector/pgvector] issue #1064: Corrupted index prevent table update
Date: Sat, 14 Nov 2026 01:06:32 +0000
Message-ID: <gh-pgvector-pgvector-1064@github.com> (raw)
We have a vector column and index defined as:
```sql
ALTER TABLE "table_name" ADD COLUMN IF NOT EXISTS "description_embedding_vector" vector(1536)
CREATE INDEX IF NOT EXISTS "IDX_index_name" ON "table_name" USING hnsw ("description_embedding_vector" vector_cosine_ops) WHERE "description_embedding_vector" IS NOT NULL;
```
Once in a while, this happen on our production system:
This error comes out of nowhere, on queries updating unrelated columns:
```
code: “22000”, message: “different vector dimensions 1536 and 0"
file: Some("vector.c"), line: Some(66), routine: Some("CheckDims")
```
The whole table is locked, cannot update any rows.
I checked and all values in the vector column are valid an has dimension 1536.
I have to remove and create the index again to fix the table:
```sql
DROP INDEX "IDX_index_name";
CREATE INDEX "IDX_index_name" ON "table_name" USING hnsw ("description_embedding_vector" vector_cosine_ops) WHERE "description_embedding_vector" IS NOT NULL;
```
After this, table is back working as normal.
This seems like a bug in pgvector, any idea?