[patch] ENUM errdetail should mention bytes, not chars

Поиск
Список
Период
Сортировка
От Ian Lawrence Barwick
Тема [patch] ENUM errdetail should mention bytes, not chars
Дата
Msg-id CAB8KJ=itZEJ7C9BacTHSYgeUysH4xx8wDiOnyppnSLyn6-g+Bw@mail.gmail.com
обсуждение исходный текст
Ответы Re: [patch] ENUM errdetail should mention bytes, not chars  (Julien Rouhaud <rjuju123@gmail.com>)
Список pgsql-hackers
Hi

The errdetail emitted when creating/modifying an ENUM value is misleading:

    postgres=# CREATE TYPE enum_valtest AS ENUM (
                'foo',
                'ああああああああああああああああああああああ'
               );
    ERROR:  invalid enum label "ああああああああああああああああああああああ"
    DETAIL:  Labels must be 63 characters or less.

Attached trivial patch changes the message to:

    DETAIL:  Labels must be 63 bytes or less.

This matches the documentation, which states:

    The length of an enum value's textual label is limited by the NAMEDATALEN
    setting compiled into PostgreSQL; in standard builds this means at most
    63 bytes.

    https://www.postgresql.org/docs/current/datatype-enum.html

I don't see any particular need to backpatch this.


Regards

Ian Barwick


--
EnterpriseDB: https://www.enterprisedb.com

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "tsunakawa.takay@fujitsu.com"
Дата:
Сообщение: RE: [POC] Fast COPY FROM command for the table with foreign partitions
Следующее
От: Julien Rouhaud
Дата:
Сообщение: Re: [patch] ENUM errdetail should mention bytes, not chars