Skip to content

Instantly share code, notes, and snippets.

@pierrejoubert73
Last active November 21, 2016 12:43
Show Gist options
  • Save pierrejoubert73/1e022318a115c15d5e422133f9d6d5d0 to your computer and use it in GitHub Desktop.
Save pierrejoubert73/1e022318a115c15d5e422133f9d6d5d0 to your computer and use it in GitHub Desktop.
How to view and alter enumerated types in PostgeSQL.
-- To view all values in the enum:
SELECT unnest(enum_range(NULL::schema.enum_name));
-- To add a value to the enum:
ALTER TYPE schema.enum_name ADD VALUE 'new_enum_value';
-- For more operation see: https://www.postgresql.org/docs/9.1/static/sql-altertype.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment