Split error message.
This commit is contained in:
parent
f10589e5f7
commit
000666bbfe
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/catalog/pg_enum.c,v 1.4 2008/01/01 19:45:48 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/catalog/pg_enum.c,v 1.5 2008/01/20 17:50:41 alvherre Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -83,14 +83,12 @@ EnumValuesCreate(Oid enumTypeOid, List *vals)
|
|||||||
* labels are stored in a name field, for easier syscache lookup, so
|
* labels are stored in a name field, for easier syscache lookup, so
|
||||||
* check the length to make sure it's within range.
|
* check the length to make sure it's within range.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (strlen(lab) > (NAMEDATALEN - 1))
|
if (strlen(lab) > (NAMEDATALEN - 1))
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_INVALID_NAME),
|
(errcode(ERRCODE_INVALID_NAME),
|
||||||
errmsg("invalid enum label \"%s\", must be %d characters or less",
|
errmsg("invalid enum label \"%s\"", lab),
|
||||||
lab,
|
errdetail("Labels must be %d characters or less.",
|
||||||
NAMEDATALEN - 1)));
|
NAMEDATALEN - 1)));
|
||||||
|
|
||||||
|
|
||||||
values[Anum_pg_enum_enumtypid - 1] = ObjectIdGetDatum(enumTypeOid);
|
values[Anum_pg_enum_enumtypid - 1] = ObjectIdGetDatum(enumTypeOid);
|
||||||
namestrcpy(&enumlabel, lab);
|
namestrcpy(&enumlabel, lab);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user