8.7.4. Implementation Details

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.
虽然设计枚举类型的初衷是存储静态值,但也可以为已有的枚举类型添加值及重命名值(参见 ALTER 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中。直接查询该目录会比较有用。
发布了341 篇原创文章 · 获赞 54 · 访问量 88万+

猜你喜欢

转载自blog.csdn.net/ghostliming/article/details/104663848
今日推荐