From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: lukas.eder@gmail.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15356: Inconsistent documentation about CREATE TYPE
Date: Tue, 13 Nov 2018 10:45:36 +0100
Message-ID: <3d48cb5f-1317-bec2-13ab-e8b83518b5b3@2ndquadrant.com> (raw)
In-Reply-To: <153546101062.1489.8367867109281960574@wrigleys.postgresql.org>
References: <153546101062.1489.8367867109281960574@wrigleys.postgresql.org>
On 28/08/2018 14:56, PG Bug reporting form wrote:
> The CREATE TYPE documentation [1] specifies that enum types without any enum
> labels are possible:
>
> CREATE TYPE name AS ENUM ( [ 'label' [, ... ] ] )
>
> I can confirm this. The following statement works well:
>
> CREATE TYPE e AS ENUM ();
>
> However, further down in the same documentation page, we can see:
>
> "Enum types take a list of one or more quoted labels"
>
> It should read "zero or more quoted labels". I suspect this should be
> adapted on all documentation pages from PostgreSQL 9.0 onwards. In 8.4, the
> documentation was consistent [2]
Right. How about the attached patch?
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Attachments:0001-doc-Clarify-CREATE-TYPE-ENUM-documentation.patch (text/plain, 1.4K) download
From fdfb4f23ead10a25e3f6acdda2eb46fb24a122df Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Tue, 13 Nov 2018 10:42:43 +0100
Subject: [PATCH] doc: Clarify CREATE TYPE ENUM documentation
The documentation claimed that an enum type requires "one or more"
labels, but since 1fd9883ff49, zero labels are also allowed.
Reported-by: Lukas Eder <lukas.eder@gmail.com>
Bug: #15356
---
doc/src/sgml/ref/create_type.sgml | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/doc/src/sgml/ref/create_type.sgml b/doc/src/sgml/ref/create_type.sgmlindex fa9b520b24..175315f3d7 100644--- a/doc/src/sgml/ref/create_type.sgml+++ b/doc/src/sgml/ref/create_type.sgml@@ -117,9 +117,12 @@ <title>Enumerated Types</title>
<para>
The second form of <command>CREATE TYPE</command> creates an enumerated
(enum) type, as described in <xref linkend="datatype-enum"/>.
- Enum types take a list of one or more quoted labels, each of which+ Enum types take a list of quoted labels, each of which
must be less than <symbol>NAMEDATALEN</symbol> bytes long (64 bytes in a
- standard <productname>PostgreSQL</productname> build).+ standard <productname>PostgreSQL</productname> build). (It is possible to+ create an enumerated type with zero labels, but such a type cannot be used+ to hold values before at least one label is added using <xref+ linkend="sql-altertype"/>.)
</para>
</refsect2>
--
2.19.1
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: peter.eisentraut@2ndquadrant.com, lukas.eder@gmail.com
Subject: Re: BUG #15356: Inconsistent documentation about CREATE TYPE
In-Reply-To: <3d48cb5f-1317-bec2-13ab-e8b83518b5b3@2ndquadrant.com>
References: <153546101062.1489.8367867109281960574@wrigleys.postgresql.org> <3d48cb5f-1317-bec2-13ab-e8b83518b5b3@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox