concept Populate_Geometry_Columns in category postgis

appears as: The Populate_Geometry_Columns, Populate_Geometry_Columns
PostGIS in Action, Third Edition

This is an excerpt from Manning's book PostGIS in Action, Third Edition.

The Populate_Geometry_Columns function

Although most alterations are easier to do with SQL, we find that the old Populate_Geometry_Columns management function is still handy at times. This powerful function will scan all unregistered geometry columns in your database or in a table that you specify. If the column is a generic geometry column or has an unknown SRID, it will examine the data to try to pinpoint the subtype and SRID. If it can identify a uniform subtype, it will add the subtype to your column definition using typmod syntax or check constraints. Similarly, if it can determine the SRID, it will add the SRID to your column definition using typmod syntax or check constraints. Populate_Geometry_Columns will obviously be unable to arrive at a subtype and SRID for columns with no data or for tables with mixed subtypes.