aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/datum.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/datum.c
parent524cfad23f31db70a23fc1fe748c050838d5fad0 (diff)
downloadpostgresql-b6a1d25b0aa179c86e0607d4c0c3b647dc5bbb87.tar.gz
postgresql-b6a1d25b0aa179c86e0607d4c0c3b647dc5bbb87.zip
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/datum.c')
-rw-r--r--src/backend/utils/adt/datum.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/backend/utils/adt/datum.c b/src/backend/utils/adt/datum.c
index 9519ef2b674..6bdfb84dd96 100644
--- a/src/backend/utils/adt/datum.c
+++ b/src/backend/utils/adt/datum.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/datum.c,v 1.25 2002/09/04 20:31:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/datum.c,v 1.26 2003/07/27 04:53:05 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -75,7 +75,10 @@ datumGetSize(Datum value, bool typByVal, int typLen)
struct varlena *s = (struct varlena *) DatumGetPointer(value);
if (!PointerIsValid(s))
- elog(ERROR, "datumGetSize: Invalid Datum Pointer");
+ ereport(ERROR,
+ (errcode(ERRCODE_DATA_EXCEPTION),
+ errmsg("invalid Datum pointer")));
+
size = (Size) VARATT_SIZE(s);
}
else if (typLen == -2)
@@ -84,12 +87,15 @@ datumGetSize(Datum value, bool typByVal, int typLen)
char *s = (char *) DatumGetPointer(value);
if (!PointerIsValid(s))
- elog(ERROR, "datumGetSize: Invalid Datum Pointer");
+ ereport(ERROR,
+ (errcode(ERRCODE_DATA_EXCEPTION),
+ errmsg("invalid Datum pointer")));
+
size = (Size) (strlen(s) + 1);
}
else
{
- elog(ERROR, "datumGetSize: Invalid typLen %d", typLen);
+ elog(ERROR, "invalid typLen: %d", typLen);
size = 0; /* keep compiler quiet */
}
}