scribase
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

sql
create extension if not exists cube with schema extensions;

Example

sql
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]);       -- true

Questions

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

More data types extensions

  • uuid-ossp UUID generators (v1 to v5).
  • pg_uuidv7 Time-ordered UUID v7 values.
  • citext Case-insensitive text, for emails and user names.
  • hstore Key-value pairs in one column.
  • ltree Tree paths such as categories and org charts.
  • intarray Functions and indexes for integer arrays.