Category: Supabase and databases

pgvector: Vector Dimension Mismatch

Read this guide in Polish

Semantic search rejects the question, because the dimension of the vector differs from the dimension of the column.

How to identify the source of the problem

Check the number of embedding dimensions of the model and type vector(n) in the table.

Compare the result for the authorized and unauthorised user, project name and exact error code.

Repair steps

Unify model and scheme, rebuild embeddings after controlled model change.

How to Test Solution

The query and all saved vectors have a corresponding dimension.

Security and restrictions

Change permissions and scheme first on test data with backup. Do not put service role in your browser.