pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
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);
```


view thread (3+ messages)  latest in thread

Message-ID: <gh-pgvector-pgvector-794@github.com>
Permalink:  ../gh-pgvector-pgvector-794@github.com/

 · 


This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox