summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/name.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-07-27 04:53:12 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-07-27 04:53:12 +0000
commitb6a1d25b0aa179c86e0607d4c0c3b647dc5bbb87 (patch)
tree7881c788c3f659b45eb371c0e40fbaf188051cb0 /src/backend/utils/adt/name.c
parent524cfad23f31db70a23fc1fe748c050838d5fad0 (diff)
Error message editing in utils/adt. Again thanks to Joe Conway for doing
the bulk of the heavy lifting ...
Diffstat (limited to 'src/backend/utils/adt/name.c')
-rw-r--r--src/backend/utils/adt/name.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/backend/utils/adt/name.c b/src/backend/utils/adt/name.c
index 37dca0b0c63..47af778f3df 100644
--- a/src/backend/utils/adt/name.c
+++ b/src/backend/utils/adt/name.c
@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.46 2003/05/15 15:50:18 petere Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.47 2003/07/27 04:53:07 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -48,12 +48,10 @@ namein(PG_FUNCTION_ARGS)
char *s = PG_GETARG_CSTRING(0);
NameData *result;
int len;
- char *ermsg;
/* verify encoding */
len = strlen(s);
- if ((ermsg = pg_verifymbstr(s, len)))
- elog(ERROR, "%s", ermsg);
+ pg_verifymbstr(s, len, false);
len = pg_mbcliplen(s, len, NAMEDATALEN - 1);
@@ -87,7 +85,11 @@ namerecv(PG_FUNCTION_ARGS)
str = pq_getmsgtext(buf, buf->len - buf->cursor, &nbytes);
if (nbytes >= NAMEDATALEN)
- elog(ERROR, "namerecv: input name too long");
+ ereport(ERROR,
+ (errcode(ERRCODE_NAME_TOO_LONG),
+ errmsg("identifier too long"),
+ errdetail("Identifier must be less than %d characters.",
+ NAMEDATALEN)));
result = (NameData *) palloc0(NAMEDATALEN);
memcpy(result, str, nbytes);
pfree(str);