postgres.git / summary / log / commit / refs
commit f4512fa5b3af82ce07ebee78f80b93aa8d654e3a
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Fri Mar 16 17:44:34 2018 +0000
First released in: 11.0, 9.3.23, 9.4.18, 9.5.13, 9.6.9, 10.4
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
doc/src/sgml/datatype.sgml | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index f7d784b288c..2ecd8040c30 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -3053,6 +3053,20 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
<sect2>
<title>Implementation Details</title>
+ <para>
+ Enum labels are case sensitive, so
+ <type>'happy'</type> is not the same as <type>'HAPPY'</type>.
+ White space in the labels is significant too.
+ </para>
+
+ <para>
+ 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 <xref linkend="sql-altertype">). 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.
+ </para>
+
<para>
An enum value occupies four bytes on disk. The length of an enum
value's textual label is limited by the <symbol>NAMEDATALEN</symbol>
@@ -3060,12 +3074,6 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
builds this means at most 63 bytes.
</para>
- <para>
- Enum labels are case sensitive, so
- <type>'happy'</type> is not the same as <type>'HAPPY'</type>.
- White space in the labels is significant too.
- </para>
-
<para>
The translations from internal enum values to textual labels are
kept in the system catalog
[parent: 492ba0694234]