Created
February 10, 2016 19:36
-
-
Save linfongi/ce1d2e80b7570acaa057 to your computer and use it in GitHub Desktop.
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 | |
t.relname AS table_name, | |
i.relname AS index_name, | |
a.attname AS column_name | |
FROM | |
pg_class t, | |
pg_class i, | |
pg_index ix, | |
pg_attribute a | |
WHERE | |
t.oid = ix.indrelid | |
AND i.oid = ix.indexrelid | |
AND a.attrelid = t.oid | |
AND a.attnum = ANY(ix.indkey) | |
AND t.relkind = 'r' | |
AND t.relname like 'folder' | |
ORDER BY | |
t.relname, | |
i.relname; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment