Data typesversion 1.5
cube
Multi-dimensional points and boxes.
What it is for
cube represents points and boxes in up to 100 dimensions with GiST indexing and distance functions. For machine-learning embeddings use vector instead; cube suits small numeric feature spaces and bounding boxes.
Enable it
create extension if not exists cube with schema extensions;Example
select cube_distance(cube(array[1, 2, 3]), cube(array[4, 5, 6])); -- 5.196...
select cube(array[0, 0], array[10, 10]) @> cube(array[3, 4]); -- trueQuestions
How do I enable cube?
Run create extension if not exists cube with schema extensions; in the SQL editor, or switch it on from the Extensions page in the console. You do not need superuser access.
Which version of cube is installed?
1.5, on Postgres 17.6, as read from the running engine on 2026-10-08. Check yours with: select extversion from pg_extension where extname = 'cube';
Upstream project: www.postgresql.org/docs/17/cube.html