This file contains hidden or 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
| -- show all tables and columns and type definitions | |
| SELECT s.schemaname,s.relname,a.attname,format_type(a.atttypid, a.atttypmod) | |
| FROM pg_attribute a | |
| INNER JOIN pg_stat_user_tables s ON s.relid = a.attrelid | |
| WHERE a.attnum > 0 | |
| ORDER BY 1,2,3 |