This is an excerpt from Manning's book PostGIS in Action, Third Edition. Login to get full access to this book.
PostGIS comes packaged with a read-only view named geometry_columns that lists all geometry columns within the database.