diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2018-03-16 13:44:34 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2018-03-16 13:44:43 -0400 |
commit | 013c0baaddd9df7e1f940184a8ab8e478214b46c (patch) | |
tree | ddd56744f7a80817c02ed77d0b5f9af45381d3c8 | |
parent | 4120864b9e0a2a119786a1839d7c0988d0523ec0 (diff) | |
download | postgresql-013c0baaddd9df7e1f940184a8ab8e478214b46c.tar.gz postgresql-013c0baaddd9df7e1f940184a8ab8e478214b46c.zip |
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
-rw-r--r-- | doc/src/sgml/datatype.sgml | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 9aa9b28f3e2..1736478a42b 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -3060,6 +3060,20 @@ SELECT person.name, holidays.num_weeks FROM person, holidays <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> setting compiled into <productname>PostgreSQL</productname>; in standard @@ -3067,12 +3081,6 @@ SELECT person.name, holidays.num_weeks FROM person, holidays </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 <link linkend="catalog-pg-enum"><structname>pg_enum</structname></link>. |