Cast a tbox
to another type
tbox::{floatrange,period}
SELECT tbox 'TBOX((1,2000-01-01),(2,2000-01-02))'::floatrange; -- "[1,2]" SELECT tbox 'TBOX((1,2000-01-01),(2,2000-01-02))'::period; -- "[2000-01-01, 2000-01-02]"
Cast another type to a tbox
{integer,float,numeric,intrange,floatrange}::tbox
,
{timestamptz,timestampset,period,periodset,tint,tfloat}::tbox
SELECT floatrange '(1.0, 2.0)'::tbox; -- "TBOX((1,),(2,))" SELECT periodset '{(2001-01-01,2001-01-02), (2001-01-03,2001-01-04)}'::tbox; -- "TBOX((,2001-01-01),(,2001-01-04))"
Cast an stbox
to a another type
stbox::{period,box2d,box3d}
SELECT stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-03))'::period; -- "[2000-01-01, 2000-01-03]" SELECT stbox 'STBOX Z((1 1 1),(3 3 3))'::box2d; -- "BOX(1 1,3 3)" SELECT stbox 'STBOX Z((1 1 1),(3 3 3))'::box3d; -- "BOX3D(1 1 1,3 3 3)"
Cast another type to an stbox
{geometry,geography,box2d,box3d}::stbox
{timestamptz,timestampset,period,periodset,tgeompoint,tgeogpoint}::stbox
SELECT geometry 'Linestring(1 1,2 2)'::stbox; -- "STBOX((1,1),(2,2))" SELECT periodset '{(2001-01-01,2001-01-02), (2001-01-03,2001-01-04)}'::stbox; -- "STBOX T((,,2001-01-01),(,,2001-01-04))"