Last active
November 24, 2017 18:22
-
-
Save cfirmo33/d55fda6c73b6544a0f4b1ffdd1f7d84d to your computer and use it in GitHub Desktop.
Lista das colunas de uma tabela
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 | |
c.relname as tableName, | |
a.attname as "Column", | |
pg_catalog.format_type(a.atttypid, a.atttypmod) as "Datatype" | |
from pg_catalog.pg_attribute a | |
inner join pg_stat_user_tables c on a.attrelid = c.relid | |
WHERE | |
a.attnum > 0 | |
AND NOT a.attisdropped | |
AND c.relname like '@TABLE_NAME' | |
AND a.attname like '%COLUNM_DESC%' | |
order by c.relname, a.attname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment