Operands of Different Dimensions

An operation relating two spatial values reads only the dimensions both of them have. Two values with Z are read in 3D. If one of them has no Z, both are read in 2D, the Z of the other one is ignored, and neither an error nor a notice is raised. The order of the operands does not change the answer.

-- A car with no Z and a plane above it are at the distance of the map
SELECT tgeompoint '[Point(0 0)@2001-01-01, Point(10 0)@2001-01-02]' |=|
  tgeompoint '[Point(0 0 10000)@2001-01-01, Point(10 0 10000)@2001-01-02]';
-- 0
-- Two values with Z are read in 3D
SELECT tgeompoint '[Point(0 0 0)@2001-01-01, Point(10 0 0)@2001-01-02]' |=|
  tgeompoint '[Point(0 0 10000)@2001-01-01, Point(10 0 10000)@2001-01-02]';
-- 10000
-- An operation building a value requires the same dimensions
SELECT merge(tgeompoint 'Point(0 0)@2001-01-01', tgeompoint 'Point(0 0 0)@2001-01-02');
-- ERROR:  The arguments must be of the same dimensionality
-- Two reference systems are not comparable
SELECT tgeompoint 'SRID=3857;Point(0 0)@2001-01-01' |=|
  tgeompoint 'SRID=4326;Point(0 0)@2001-01-01';
-- ERROR:  Operation on mixed SRID

Since the rule raises no error, a value that lacks its Z by mistake answers in 2D with no warning. The functions ??? state the dimensions to read. A column declared with a Z dimension, such as tgeompoint(Sequence, PointZ), accepts no value with no Z, so that a table cannot hold one.