Last active
September 9, 2021 12:04
-
-
Save ghobadkhan/097f89afdcb55637a587d5c45ef3e973 to your computer and use it in GitHub Desktop.
Lists all stored enums in a human readable format - Postgresql
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 | |
type.typname AS name, | |
string_agg(enum.enumlabel, '|') AS value | |
FROM pg_enum AS enum | |
JOIN pg_type AS type | |
ON (type.oid = enum.enumtypid) | |
GROUP BY type.typname; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example Result