postgresql_16:9.6.11.1 Syntax
PostgreSQL 16 > Appendixes > Additional Supplied Modules and Extensions > cube — a multi-dimensional cube data type > Syntax
(see cube-repr-table) shows the valid external representations for the cube type. *x*, *y*, etc. denote floating-point numbers.
| External Syntax | Meaning | | --- | --- | | *x* | A one-dimensional point (or, zero-length one-dimensional interval) | | (*x*) | Same as above | | *x1*,*x2*,...,*xn* | A point in n-dimensional space, represented internally as a zero-volume cube | | (*x1*,*x2*,...,*xn*) | Same as above | | (*x*),(*y*) | A one-dimensional interval starting at *x* and ending at *y* or vice versa; the order does not matter | | [(*x*),(*y*)] | Same as above | | (*x1*,...,*xn*),(*y1*,...,*yn*) | An n-dimensional cube represented by a pair of its diagonally opposite corners | | [(*x1*,...,*xn*),(*y1*,...,*yn*)] | Same as above |
It does not matter which order the opposite corners of a cube are entered in. The cube functions automatically swap values if needed to create a uniform “lower left — upper right” internal representation. When the corners coincide, cube stores only one corner along with an “is point” flag to avoid wasting space.
White space is ignored on input, so [(*x*),(*y*)] is the same as [ ( *x* ), ( *y* ) ].