Created
August 13, 2020 15:57
-
-
Save moraisaugusto/5b0a8f3263c00debe691fb903ecd44a0 to your computer and use it in GitHub Desktop.
Postgresql - ENUM values
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
-- Create enumetation | |
CREATE TYPE currency AS ENUM ('USD', 'BRL', 'USD'); | |
-- Add value | |
ALTER TYPE currency ADD VALUE 'GBP'; | |
-- Remove value | |
DELETE FROM pg_enum | |
WHERE enumlabel = 'GBP' | |
AND enumtypid = ( SELECT oid FROM pg_type WHERE typname = 'currency') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment