Skip to content

Commit 21c90df

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
1 parent fcc15bf commit 21c90df

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
@@ -3050,19 +3050,27 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
30503050
<sect2>
30513051
<title>Implementation Details</title>
30523052

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

3060-
<para>
3061-
Enum labels are case sensitive, so
3062-
<type>'happy'</type> is not the same as <type>'HAPPY'</type>.
3063-
White space in the labels is significant too.
3064-
</para>
3065-
30663074
<para>
30673075
The translations from internal enum values to textual labels are
30683076
kept in the system catalog

0 commit comments

Comments
 (0)