diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-07-21 20:29:40 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-07-21 20:29:40 +0000 |
commit | ec7aa4b51545e0c1c69acc0cf135d9c229f61d11 (patch) | |
tree | a901aaeecf544061017be45bb1defbb92a1b2b03 /src/backend/access/heap/hio.c | |
parent | c6106d91e2dba7721d1ace5f30946debe9689b3b (diff) |
Error message editing in backend/access.
Diffstat (limited to 'src/backend/access/heap/hio.c')
-rw-r--r-- | src/backend/access/heap/hio.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/backend/access/heap/hio.c b/src/backend/access/heap/hio.c index 53cf41c4449..7f575d1e894 100644 --- a/src/backend/access/heap/hio.c +++ b/src/backend/access/heap/hio.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Id: hio.c,v 1.47 2003/02/13 05:35:11 momjian Exp $ + * $Id: hio.c,v 1.48 2003/07/21 20:29:38 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -23,7 +23,7 @@ /* * RelationPutHeapTuple - place tuple at specified page * - * !!! ELOG(ERROR) IS DISALLOWED HERE !!! + * !!! EREPORT(ERROR) IS DISALLOWED HERE !!! Must PANIC on failure!!! * * Note - caller must hold BUFFER_LOCK_EXCLUSIVE on the buffer. */ @@ -44,7 +44,7 @@ RelationPutHeapTuple(Relation relation, tuple->t_len, InvalidOffsetNumber, LP_USED); if (offnum == InvalidOffsetNumber) - elog(PANIC, "RelationPutHeapTuple: failed to add tuple"); + elog(PANIC, "failed to add tuple to page"); /* Update tuple->t_self to the actual position where it was stored */ ItemPointerSet(&(tuple->t_self), BufferGetBlockNumber(buffer), offnum); @@ -84,7 +84,7 @@ RelationPutHeapTuple(Relation relation, * for indices only. Alternatively, we could define pseudo-table as * we do for transactions with XactLockTable. * - * ELOG(ERROR) is allowed here, so this routine *must* be called + * ereport(ERROR) is allowed here, so this routine *must* be called * before any (unlogged) changes are made in buffer pool. */ Buffer @@ -104,8 +104,11 @@ RelationGetBufferForTuple(Relation relation, Size len, * If we're gonna fail for oversize tuple, do it right away */ if (len > MaxTupleSize) - elog(ERROR, "Tuple is too big: size %lu, max size %ld", - (unsigned long) len, MaxTupleSize); + ereport(ERROR, + (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), + errmsg("tuple is too big: size %lu, maximum size %lu", + (unsigned long) len, + (unsigned long) MaxTupleSize))); if (otherBuffer != InvalidBuffer) otherBlock = BufferGetBlockNumber(otherBuffer); @@ -268,7 +271,7 @@ RelationGetBufferForTuple(Relation relation, Size len, if (len > PageGetFreeSpace(pageHeader)) { /* We should not get here given the test at the top */ - elog(PANIC, "Tuple is too big: size %lu", (unsigned long) len); + elog(PANIC, "tuple is too big: size %lu", (unsigned long) len); } /* |