ST_DIFFERENCE
Returns the part of the first GEOMETRY object that is not covered by the second GEOMETRY object.
This function only supports GEOMETRY values.
Syntax
ST_DIFFERENCE(<geometry1>, <geometry2>)
Arguments
Return Type
GEOMETRY.
Examples
SELECT ST_ASWKT(ST_DIFFERENCE(TO_GEOMETRY('POINT(0 0)'), TO_GEOMETRY('POINT(1 1)')));
╭───────────────────────────────────────────────────────────────────────────────╮
│ st_aswkt(st_difference(to_geometry('POINT(0 0)'), to_geometry('POINT(1 1)'))) │
├───────────────────────────────────────────────────────────────────────────────┤
│ POINT(0 0) │
╰───────────────────────────────────────────────────────────────────────────────╯