syntax error with alter type
От | Kevin Brannen |
---|---|
Тема | syntax error with alter type |
Дата | |
Msg-id | SN1PR19MB0255E21F90F7B01FBD4CF835A4AA0@SN1PR19MB0255.namprd19.prod.outlook.com обсуждение исходный текст |
Ответы |
Re: syntax error with alter type
|
Список | pgsql-general |
I’m running Pg 9.6.5 if it matters…
I’m trying to drop a value from an ENUM (type) and it seems like I’m following the fine manual yet I still get an error. For example:
nms=# create type alphabet as enum ('a', 'b', 'c', 'd');
CREATE TYPE
nms=# alter type alphabet drop attribute if exists 'c';
ERROR: 42601: syntax error at or near "'c'"
LINE 1: alter type alphabet drop attribute if exists 'c';
^
LOCATION: scanner_yyerror, scan.l:1086
What am I doing wrong? The goal is to get rid of the ‘c’ value from the enum. Yes, you can assume I’ve already removed of all the ‘c’ values in the table where it’s used.
Or does that statement not do what I think it does and I have to do the “create new type, change the table to use the new type, drop old type, rename new type to old type” routine?
Thanks,
Kevin
В списке pgsql-general по дате отправления: