Last active
May 9, 2019 20:49
-
-
Save hooopo/31b91ad64b86a77ad7eda09fd7725e6e to your computer and use it in GitHub Desktop.
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
SELECT | |
pg_attribute.attname, | |
format_type(pg_attribute.atttypid, pg_attribute.atttypmod) | |
FROM | |
pg_index, pg_class, pg_attribute, pg_namespace | |
WHERE | |
nspname = 'public' AND | |
relname = 'orders' AND | |
indrelid = pg_class.oid AND | |
pg_class.relnamespace = pg_namespace.oid AND | |
pg_attribute.attrelid = pg_class.oid AND | |
pg_attribute.attnum = any(pg_index.indkey) AND | |
indisprimary; | |
attname | format_type | |
---------+------------- | |
id | bigint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment