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
diff --git a/src/backend/catalog/pg_enum.c b/src/backend/catalog/pg_enum.c index 27e4100a6f..6a2c6685a0 100644 --- a/src/backend/catalog/pg_enum.c +++ b/src/backend/catalog/pg_enum.c @@ -125,7 +125,7 @@ EnumValuesCreate(Oid enumTypeOid, List *vals) ereport(ERROR, (errcode(ERRCODE_INVALID_NAME), errmsg("invalid enum label \"%s\"", lab), - errdetail("Labels must be %d characters or less.", + errdetail("Labels must be %d bytes or less.", NAMEDATALEN - 1))); values[Anum_pg_enum_oid - 1] = ObjectIdGetDatum(oids[elemno]); @@ -228,7 +228,7 @@ AddEnumLabel(Oid enumTypeOid, ereport(ERROR, (errcode(ERRCODE_INVALID_NAME), errmsg("invalid enum label \"%s\"", newVal), - errdetail("Labels must be %d characters or less.", + errdetail("Labels must be %d bytes or less.", NAMEDATALEN - 1))); /* @@ -523,7 +523,7 @@ RenameEnumLabel(Oid enumTypeOid, ereport(ERROR, (errcode(ERRCODE_INVALID_NAME), errmsg("invalid enum label \"%s\"", newVal), - errdetail("Labels must be %d characters or less.", + errdetail("Labels must be %d bytes or less.", NAMEDATALEN - 1))); /* diff --git a/src/backend/po/de.po b/src/backend/po/de.po index fd3b640c16..d7ce2a8ea7 100644 --- a/src/backend/po/de.po +++ b/src/backend/po/de.po @@ -5161,7 +5161,7 @@ msgstr "ungültiges Enum-Label »%s«" #: catalog/pg_enum.c:128 catalog/pg_enum.c:231 catalog/pg_enum.c:526 #, c-format -msgid "Labels must be %d characters or less." +msgid "Labels must be %d bytes or less." msgstr "Labels müssen %d oder weniger Zeichen haben." #: catalog/pg_enum.c:259 diff --git a/src/backend/po/es.po b/src/backend/po/es.po index 8b24205d3f..b070b90fc3 100644 --- a/src/backend/po/es.po +++ b/src/backend/po/es.po @@ -5227,7 +5227,7 @@ msgstr "la etiqueta enum «%s» no es válida" #: catalog/pg_enum.c:128 catalog/pg_enum.c:231 catalog/pg_enum.c:526 #, c-format -msgid "Labels must be %d characters or less." +msgid "Labels must be %d bytes or less." msgstr "Las etiquetas deben ser de %d caracteres o menos." #: catalog/pg_enum.c:259 diff --git a/src/backend/po/fr.po b/src/backend/po/fr.po index 925ad1780d..c3eada67e5 100644 --- a/src/backend/po/fr.po +++ b/src/backend/po/fr.po @@ -4751,7 +4751,7 @@ msgstr "nom du label enum « %s » invalide" #: catalog/pg_enum.c:129 catalog/pg_enum.c:232 catalog/pg_enum.c:527 #, c-format -msgid "Labels must be %d characters or less." +msgid "Labels must be %d bytes or less." msgstr "Les labels doivent avoir au plus %d caractères." #: catalog/pg_enum.c:260 diff --git a/src/backend/po/id.po b/src/backend/po/id.po index d5d484132b..0d1d48c8e4 100644 --- a/src/backend/po/id.po +++ b/src/backend/po/id.po @@ -3305,7 +3305,7 @@ msgstr "label enum tidak valid « %s »" #: catalog/pg_enum.c:115 catalog/pg_enum.c:202 #, c-format -msgid "Labels must be %d characters or less." +msgid "Labels must be %d bytes or less." msgstr "label harus %d karakter atau kurang" #: catalog/pg_enum.c:230 diff --git a/src/backend/po/it.po b/src/backend/po/it.po index 139d84b6ff..996b060091 100644 --- a/src/backend/po/it.po +++ b/src/backend/po/it.po @@ -4745,7 +4745,7 @@ msgstr "etichetta enumerata non valida \"%s\"" #: catalog/pg_enum.c:116 catalog/pg_enum.c:202 catalog/pg_enum.c:489 #, c-format -msgid "Labels must be %d characters or less." +msgid "Labels must be %d bytes or less." msgstr "Le etichette devono essere lunghe %d caratteri o meno." #: catalog/pg_enum.c:230 diff --git a/src/backend/po/ja.po b/src/backend/po/ja.po index 974380e3e5..9bae196f42 100644 --- a/src/backend/po/ja.po +++ b/src/backend/po/ja.po @@ -4925,7 +4925,7 @@ msgstr "列挙ラベル\"%s\"は不正です" #: catalog/pg_enum.c:129 catalog/pg_enum.c:232 catalog/pg_enum.c:527 #, c-format -msgid "Labels must be %d characters or less." +msgid "Labels must be %d bytes or less." msgstr "ラベルは%d文字数以内でなければなりません" #: catalog/pg_enum.c:260 diff --git a/src/backend/po/ko.po b/src/backend/po/ko.po index 7c87329811..db8045e931 100644 --- a/src/backend/po/ko.po +++ b/src/backend/po/ko.po @@ -5345,7 +5345,7 @@ msgstr "\"%s\" 열거형 라벨이 잘못됨" #: catalog/pg_enum.c:129 catalog/pg_enum.c:232 catalog/pg_enum.c:527 #, c-format -msgid "Labels must be %d characters or less." +msgid "Labels must be %d bytes or less." msgstr "라벨은 %d자 이하여야 합니다." #: catalog/pg_enum.c:260 diff --git a/src/backend/po/pl.po b/src/backend/po/pl.po index 3ac9d0451c..56e88ae417 100644 --- a/src/backend/po/pl.po +++ b/src/backend/po/pl.po @@ -4819,7 +4819,7 @@ msgstr "nieprawidłowa etykieta enumeracji \"%s\"" #: catalog/pg_enum.c:116 catalog/pg_enum.c:202 catalog/pg_enum.c:489 #, c-format -msgid "Labels must be %d characters or less." +msgid "Labels must be %d bytes or less." msgstr "Etykieta musi posiadać %d znaków lub mniej." #: catalog/pg_enum.c:230 diff --git a/src/backend/po/pt_BR.po b/src/backend/po/pt_BR.po index 37e4a28f07..228ed8d79a 100644 --- a/src/backend/po/pt_BR.po +++ b/src/backend/po/pt_BR.po @@ -3623,7 +3623,7 @@ msgstr "rótulo do enum \"%s\" é inválido" #: catalog/pg_enum.c:116 catalog/pg_enum.c:203 #, c-format -msgid "Labels must be %d characters or less." +msgid "Labels must be %d bytes or less." msgstr "Rótulos devem conter %d caracteres ou menos." #: catalog/pg_enum.c:231 diff --git a/src/backend/po/ru.po b/src/backend/po/ru.po index 1b7d2b945f..228831af95 100644 --- a/src/backend/po/ru.po +++ b/src/backend/po/ru.po @@ -5549,7 +5549,7 @@ msgstr "неверная метка в перечислении \"%s\"" #: catalog/pg_enum.c:129 catalog/pg_enum.c:232 catalog/pg_enum.c:527 #, c-format -msgid "Labels must be %d characters or less." +msgid "Labels must be %d bytes or less." msgstr "Длина метки не должна превышать %d байт." #: catalog/pg_enum.c:260 diff --git a/src/backend/po/sv.po b/src/backend/po/sv.po index 0613dcecc3..ec33f0ce8d 100644 --- a/src/backend/po/sv.po +++ b/src/backend/po/sv.po @@ -5157,7 +5157,7 @@ msgstr "ogiltig enum-etikett \"%s\"" #: catalog/pg_enum.c:128 catalog/pg_enum.c:231 catalog/pg_enum.c:526 #, c-format -msgid "Labels must be %d characters or less." +msgid "Labels must be %d bytes or less." msgstr "Etiketter måste vara %d tecken eller färre." #: catalog/pg_enum.c:259 diff --git a/src/backend/po/tr.po b/src/backend/po/tr.po index b791e886b9..31cf634bf0 100644 --- a/src/backend/po/tr.po +++ b/src/backend/po/tr.po @@ -4581,7 +4581,7 @@ msgstr "Geçersiz enum etiketi: \"%s\"" #: catalog/pg_enum.c:129 catalog/pg_enum.c:232 catalog/pg_enum.c:527 #, c-format -msgid "Labels must be %d characters or less." +msgid "Labels must be %d bytes or less." msgstr "Etiketler %d karakter ya da daha az olmalıdır." #: catalog/pg_enum.c:260 diff --git a/src/backend/po/zh_CN.po b/src/backend/po/zh_CN.po index 574684d775..204d452bc8 100644 --- a/src/backend/po/zh_CN.po +++ b/src/backend/po/zh_CN.po @@ -4800,7 +4800,7 @@ msgstr "无效的枚举类型标签 \"%s\"" #: catalog/pg_enum.c:129 catalog/pg_enum.c:232 catalog/pg_enum.c:527 #, c-format -msgid "Labels must be %d characters or less." +msgid "Labels must be %d bytes or less." msgstr "标签必需为 %d 个字符或更少" #: catalog/pg_enum.c:260