From: lll-lll-lll-lll (@lll-lll-lll-lll) <noreply+lll-lll-lll-lll@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: [pgvector/pgvector] issue #794: Question| Should vector(N) perform a dimension check even if no check constraint is applied?
Date: Wed, 05 Mar 2025 10:25:37 +0000
Message-ID: <gh-pgvector-pgvector-794@github.com> (raw)
The documentation states the following, but is it necessary to attach a check constraint to vector(N)?
```
Optionally, add a [check constraint](https://www.postgresql.org/docs/current/ddl-constraints.html) to ensure data can be converted to the vector type and has the expected dimensions.
ALTER TABLE items ADD CHECK (vector_dims(embedding::vector) = 3);
```