pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #15356: Inconsistent documentation about CREATE TYPE
4+ messages / 3 participants
[nested] [flat]

* BUG #15356: Inconsistent documentation about CREATE TYPE
@ 2018-08-28 12:56  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 4+ messages in thread

From: PG Bug reporting form @ 2018-08-28 12:56 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: lukas.eder@gmail.com

The following bug has been logged on the website:

Bug reference:      15356
Logged by:          Lukas Eder
Email address:      lukas.eder@gmail.com
PostgreSQL version: 10.5
Operating system:   Windows
Description:        

Hello,

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]

[1]: https://www.postgresql.org/docs/current/static/sql-createtype.html
[2]: https://www.postgresql.org/docs/8.4/static/sql-createtype.html



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #15356: Inconsistent documentation about CREATE TYPE
@ 2018-11-13 09:45  Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  parent: PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 4+ messages in thread

From: Peter Eisentraut @ 2018-11-13 09:45 UTC (permalink / raw)
  To: lukas.eder@gmail.com; pgsql-bugs@lists.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.sgml index 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
^ permalink raw reply [nested|flat] 4+ messages in thread

* Re: BUG #15356: Inconsistent documentation about CREATE TYPE
@ 2018-11-13 10:01  Lukas Eder <lukas.eder@gmail.com>
  parent: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Lukas Eder @ 2018-11-13 10:01 UTC (permalink / raw)
  To: peter.eisentraut@2ndquadrant.com; +Cc: pgsql-bugs@lists.postgresql.org

On Tue, Nov 13, 2018 at 10:45 AM Peter Eisentraut <
peter.eisentraut@2ndquadrant.com> wrote:

> 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?
>

Makes sense, thanks

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #15356: Inconsistent documentation about CREATE TYPE
@ 2018-11-20 08:53  Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  parent: Lukas Eder <lukas.eder@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Peter Eisentraut @ 2018-11-20 08:53 UTC (permalink / raw)
  To: Lukas Eder <lukas.eder@gmail.com>; +Cc: pgsql-bugs@lists.postgresql.org

On 13/11/2018 11:01, Lukas Eder 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?
> 
> Makes sense, thanks 

committed

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2018-11-20 08:53 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-08-28 12:56 BUG #15356: Inconsistent documentation about CREATE TYPE PG Bug reporting form <noreply@postgresql.org>
2018-11-13 09:45 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2018-11-13 10:01   ` Lukas Eder <lukas.eder@gmail.com>
2018-11-20 08:53     ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

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