Skip to content

Instantly share code, notes, and snippets.

@twopoint718
Created August 22, 2023 20:30
Show Gist options
  • Save twopoint718/5a4b275d4b85799cb9ad75dadf8daeac to your computer and use it in GitHub Desktop.
Save twopoint718/5a4b275d4b85799cb9ad75dadf8daeac to your computer and use it in GitHub Desktop.
List custom types along with their enum values
-- list types and their enum values
SELECT
pg_type.typname AS enumtype,
array_agg(pg_enum.enumlabel) AS enumlabels
FROM
pg_type
JOIN pg_enum ON pg_enum.enumtypid = pg_type.oid
GROUP BY pg_type.typname;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment