Re: [patch] ENUM errdetail should mention bytes, not chars

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>, Ian Lawrence Barwick <barwick(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [patch] ENUM errdetail should mention bytes, not chars
Date: 2020-10-27 11:00:33
Message-ID: a0e3e2e5-7184-233b-462e-435e1490b85b@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-10-19 06:34, Julien Rouhaud wrote:
>> 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.
>
> Indeed the message is wrong, and patch LGTM.

Committed. Btw., the patch didn't update the regression test output.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2020-10-27 11:05:25 Re: Prevent printing "next step instructions" in initdb and pg_upgrade
Previous Message Bruce Momjian 2020-10-27 10:53:08 Re: Prevent printing "next step instructions" in initdb and pg_upgrade