The query could be run against the geometry_columnsgeometry_columns
table in this way
SELECT type
FROM geometry_columns
WHERE f_table_schema = 'my_schema'
AND f_table_name = 'building'
and f_geometry_column = 'geom';
SELECT type
FROM geometry_columns
WHERE f_table_schema = 'my_schema'
AND f_table_name = 'building'
and f_geometry_column = 'geom';
(or, if you are using a geographygeography type, subsititute geometry_columnsgeometry_columns
with geography_columnsgeography_columns
and f_geometry_columnf_geometry_column
with f_geography_columnf_geography_column
)