8.7.4. Implementation Details
8.7.4.实现细节
Enum labels are case sensitive, so
'happy'
is not the same as
'HAPPY'
. White space in the labels
is significant too.
枚举类型的值是大小写敏感的,所以‘happy’与‘HAPPY’是不同的。其内的空白也是很重要的。
Although enum types are primarily intended for static sets of values, there is support for adding new
values to an existing enum type, and for renaming values (see ALTER TYPE). Existing values cannot
be removed from an enum type, nor can the sort ordering of such values be changed, short of dropping
and re-creating the enum type.
An enum value occupies four bytes on disk. The length of an enum value's textual label is limited by
the
NAMEDATALEN
setting compiled into PostgreSQL; in standard builds this means at most 63 bytes.
一个枚举类型占用磁盘上的4字节。
枚举值的文本标签的长度受编译到PostgreSQL中的NAMEDATALEN设置的限制; 在标准版本中,这意味着最多63个字节。
The translations from internal enum values to textual labels are kept in the system catalog
pg_enum
.
Querying this catalog directly can be useful.
从内部枚举值到文本标签的转换保存在系统目录pg_enum中。直接查询该目录会比较有用。