Created
September 9, 2019 07:41
-
-
Save rkolka/a46e66366e16b160af078130fff05560 to your computer and use it in GitHub Desktop.
count geomtypes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
string_agg(stmt, E' union all\n') as union_stmt | |
from | |
( | |
select | |
table_schema | |
, table_name | |
, column_name | |
, format($$select %1$L || '.' || %2$L || '.' || %3$L as col, ST_GeometryType(%3$I), count(*) as arv from %1$I.%2$I group by ST_GeometryType(%3$I)$$ , table_schema , table_name , column_name ) as stmt | |
from | |
information_schema.columns c | |
where | |
udt_name = 'geometry' | |
) as dummy | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment