[ IF NOT EXISTS ] new_enum_value [ { BEFORE | AFTER } neighbor_enum_value ] ALTER TYPE name RENAME VALUE existing_enum_value TO new_enum_value ALTER TYPE name SET ( property = value [, ... ] ) 这里 action 是以下之一:
Bug description Using migrations from version 2.14, I updated an enum to add a few more values. That generated the following migration. -- AlterEnum ALTER TYPE "account_type_enum" ADD VALUE 'Giving'; ALTER TYPE "account_type_enum" ADD VA...
ALTER TYPE email SET SCHEMA customers; 给一个数据类型增加一个新的属性: ALTER TYPE compfoo ADD ATTRIBUTE f3 int; 给一个枚举类型增加一个指定位置的新值: ALTER TYPE colors ADD VALUE 'orange' AFTER 'red';兼容性 增加或删除属性是SQL标准,其他选项都是PostgreSQL的扩展。
new_enum_value 这里action 是以下之一: ADD ATTRIBUTE attribute_name data_type [ COLLATE collation ] [ CASCADE | RESTRICT ] DROP ATTRIBUTE [ IF EXISTS ] attribute_name [ CASCADE | RESTRICT ] ALTER ATTRIBUTE attribute_name [ SET DATA ] TYPE data_type [ COLLATE collation ] [ CASCADE | ...
type test2 as enum ('Café','Wrocław'); ERROR: character with byte sequence 0xc5 0x82 in encoding "UTF8" has no equivalent in encoding "LATIN1" --- PostgreSQL handles character set encodings on a cluster and database level, not on a table/column level. PostgreSQL doesn't have ...