cover on INSERT
take level
(even when NULL or nothing) as Z
wastewater_node on INSERT
take bottom level
(even when NULL or nothing) as Z
reach and reach_point on INSERT
take level
of reach_point
(even when NULL or nothing) as Z of reach_point
and reach
cover ON UPDATE
if level
changed, take level
as Z / if not: if Z changed, take Z as level
wastewater_node on UPDATE
if bottom_level
changed, take bottom_level
as Z / if not: if Z changed, take Z as bottom_level
reach and reach_point on UPDATE
if level
of reach_point
changed, take level
as Z of reach_point
and reach
/ if not: if Z changed, take Z as level
of reach_point