Last active
November 21, 2016 12:43
-
-
Save pierrejoubert73/1e022318a115c15d5e422133f9d6d5d0 to your computer and use it in GitHub Desktop.
How to view and alter enumerated types in PostgeSQL.
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
-- 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