Database Development

How to get the type of geometry column in postgres?

I need to determine the type of geometry column and doing it with the following query:

SELECT type 
FROM   geometry_columns 
WHERE  f_table_schema = 'public' 
       AND f_table_name = 'table_name' 
       AND f_geometry_column = 'col_name' 

It works fine for regular geometries, like Point or Polygon. But then there are also some fancy geometries like PointZ. How do I determine if column has it? Above mentioned query returns just POINT for it.

Leave a Reply

Your email address will not be published. Required fields are marked *