The constructor function for the set types has a single argument that is an array of values of the corresponding base type. The values must be ordered and cannot have nulls or duplicates.
The unit span types have a constructor function that accepts four arguments. The first two arguments specify, respectively, the lower and upper bound, and the last two arguments are Boolean values stating, respectively, whether the lower and upper bounds are inclusive or not. The last two arguments are assumed to be, respectively, true and false if not specified. Notice that integer spans are transformed into normal form, that is, with inclusive lower bound and exclusive upper bound.
Constructor for span types
span(lower base,upper base,leftInc bool=true,rightInc bool=false) → span
SELECT span(20.5, 25); -- [20.5, 25) SELECT span(20, 25, false, true); -- [21, 26) SELECT span(timestamptz '2001-01-01 08:00:00', '2001-01-03 09:30:00', false, true); -- (2001-01-01 08:00:00, 2001-01-03 09:30:00]
The constructor function for span set types have a single argument that is an array of span values of the same subtype.
Constructor for span set types
spanset(span[]) → spanset
SELECT spanset(ARRAY[intspan '[10,12]', '[13,15]']); -- {[10, 16)} SELECT spanset(ARRAY[floatspan '[10.5,12.5]', '[13.5,15.5]']); -- {[10.5, 12.5], [13.5, 15.5]} SELECT spanset(ARRAY[tstzspan '[2001-01-01 08:00, 2001-01-01 08:10]', '[2001-01-01 08:20, 2001-01-01 08:40]']); -- {[2001-01-01 08:00, 2001-01-01 08:10], [2001-01-01 08:20, 2001-01-01 08:40]};