Select Empty Geometry Columns in PostGIS

postgispostgresql

I try to select rows in Postgis that have an empty geometry column.

This works but gives me the opposite:

SELECT * FROM foo where geom <> '';

And this fails:

SELECT * FROM foo where geom = '';

>>>ERROR: parse error - invalid geometry
>>>SQL state: XX000
>>>Hint: You must specify a valid OGC WKT geometry type such as POINT, LINESTRING or POLYGON

And this returns nothing:

SELECT * FROM foo where ST_IsEmpty(geom);

Does anyone know the correct syntax?

Best Answer

how about

select * from district.airport  where geom is NULL;
Related Question