On Sat, May 4, 2013 at 11:19 PM, Stas Kelvich <stanc...@gmail.com> wrote:
> > I think we have at least 3 data types more or less similar to cube. > > 1) array of ranges > > 2) range of arrays > > 3) 2d arrays > > Semantically cube is most close to array or ranges. However array of > ranges have huge storage overhead. > > Also we can declare cube as domain on 2d arrays and declare operations > of that domain. > > But what we should do when arrays in different records have different > numbers of element? > We can be faced with absolutely same situation with cube. test=# create table cube_test (v cube); CREATE TABLE test=# insert into cube_test values (cube(array[1,2])), (cube(array[1,2,3])); INSERT 0 2 In order to force all cubes to have same number of dimensions excplicit CHECK on table is required. As I remember cube treats absent dimensions as zeros. ------ With best regards, Alexander Korotkov.