10000 Doc: explicitly point out that enum values can't be dropped. · linzhihui/postgres@f4512fa · GitHub
[go: up one dir, main page]

Skip to content

Commit f4512fa

Browse files
committed
Doc: explicitly point out that enum values can't be dropped.
This was not stated in so many words anywhere. Document it to make clear that it's a design limitation and not just an oversight or documentation omission. Discussion: https://postgr.es/m/152089733343.1222.6927268289645380498@wrigleys.postgresql.org
< 10000 div width="60px" height="22px" class="Box-sc-g0xbh4-0 LoadingSkeleton-sc-695d630a-0 kHfwUD kRBfod">
1 parent 492ba06 commit f4512fa

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

doc/src/sgml/datatype.sgml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3053,19 +3053,27 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
30533053
<sect2>
30543054
<title>Implementation Details</title>
30553055

3056+
<para>
3057+
Enum labels are case sensitive, so
3058+
<type>'happy'</type> is not the same as <type>'HAPPY'</type>.
3059+
White space in the labels is significant too.
3060+
</para>
3061+
3062+
<para>
3063+
Although enum types are primarily intended for static sets of values,
3064+
there is support for adding new values to an existing enum type, and for
3065+
renaming values (see <xref linkend="sql-altertype">). Existing values
3066+
cannot be removed from an enum type, nor can the sort ordering of such
3067+
values be changed, short of dropping and re-creating the enum type.
3068+
</para>
3069+
30563070
<para>
30573071
An enum value occupies four bytes on disk. The length of an enum
30583072
value's textual label is limited by the <symbol>NAMEDATALEN</symbol>
30593073
setting compiled into <productname>PostgreSQL</productname>; in standard
30603074
builds this means at most 63 bytes.
30613075
</para>
30623076

3063-
<para>
3064-
Enum labels are case sensitive, so
3065-
<type>'happy'</type> is not the same as <type>'HAPPY'</type>.
3066-
White space in the labels is significant too.
3067-
</para>
3068-
30693077
<para>
30703078
The translations from internal enum values to textual labels are
30713079
kept in the system catalog

0 commit comments

Comments
 (0)
0