8.7.4. Implementation Details

8.7.4. Implementation Details
8.7.4. Implementation Details
Enum labels are case sensitive, so 'happy' is not the same as 'HAPPY' . White space in the labels  is significant too.
An enumerated type value is case-sensitive, so 'happy' and 'HAPPY' are different. Blank within it is also very important.
 
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.
Although the design of the original intention of the enumerated type is stored in a static value, but can also be added to an existing enumeration type value and rename the value (see the ALTER the TYPE ). Enumerated type has a value can not be deleted nor can change the order, delete or rebuild unless the enumerated 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.
An enumeration type 4 bytes on disk occupancy. Text labels compiled by the enumeration values to limit NAMEDATALEN set in PostgreSQL; in the standard version, which means that up to 63 bytes.
 
The translations from internal enum values to textual labels are kept in the system catalog pg_enum . Querying this catalog directly can be useful.
Enum values ​​from the internal to convert text labels stored in the system directory pg_enum in. Direct access to the directory can be useful.
Published 341 original articles · won praise 54 · views 880 000 +

Guess you like

Origin blog.csdn.net/ghostliming/article/details/104663848