Created
April 20, 2017 13:06
-
-
Save gacarrillor/68763273fe86e478d8e0ae40dce5f101 to your computer and use it in GitHub Desktop.
isdomain field definition
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 | |
tbls.schemaname AS schemaname, | |
tbls.tablename AS tablename, | |
a.attname AS primary_key, | |
g.f_geometry_column AS geometry_column, | |
g.srid AS srid, | |
g.type AS type, | |
(cols.column_name = 'ilicode') AS isdomain | |
FROM pg_catalog.pg_tables tbls | |
LEFT JOIN pg_index i | |
ON i.indrelid = CONCAT(tbls.schemaname, '.', tbls.tablename)::regclass | |
LEFT JOIN pg_attribute a | |
ON a.attrelid = i.indrelid | |
AND a.attnum = ANY(i.indkey) | |
LEFT JOIN public.geometry_columns g | |
ON g.f_table_schema = tbls.schemaname | |
AND g.f_table_name = tbls.tablename | |
LEFT JOIN information_schema.columns cols | |
ON cols.table_schema = tbls.schemaname | |
AND cols.table_name = tbls.tablename | |
AND column_name = 'ilicode' | |
WHERE i.indisprimary |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment