pgvector extension of PostgreSQL. As in other parts of the SQL specification, there are deviations from PostgreSQL where needed to support RegattaDB’s performance and functionality.
The Vector Data Type
In order to support vector indexing and searches, we introduce theVECTOR type. This type is not a generic vector. A VECTOR column has one parameter that defines the dimension of all the vectors in the table column. In addition, the following applies to vector columns:
- A vector column’s dimension can be any integer between 1 and 2048 (inclusive).
-
The data type of the vector elements is
REAL (FLOAT4) -
Elements of the vector cannot be
NULLand cannot have any of the values Infinity, -Infinity or NaN. -
A vector column can be nullable. The
NOT NULLconstraint is supported. -
UNIQUEandPRIMARY KEYconstraints are not supported. - A vector column cannot be a foreign key or target of a foreign key.
- Regular index for a vector column is not supported.
-
Vector values are passed as strings following
pgvectorsyntax.
Vector Index Operators
The following are binary operators that return the distance between two vectors. The vectors must be of the same dimension. L2 distance (negative) Inner product Cosine distance- No other operators or functions are supported for the vector type (e.g., no vector arithmetic such as adding vectors or multiplying a vector by a scalar).
- No aggregations are supported on vector columns.