Skip to main content
This section describes the RegattaDB SQL specification for vector indexing.  The RegattaDB specification follows the style of the 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 the VECTOR 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 NULL and cannot have any of the values Infinity, -Infinity or NaN. 
  • A vector column can be nullable. The NOT NULL constraint is supported. 
  • UNIQUE and PRIMARY KEY constraints 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 pgvector syntax. 
For example:

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.