1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Error message editing in contrib (mostly by Joe Conway --- thanks Joe!)

This commit is contained in:
Tom Lane
2003-07-24 17:52:50 +00:00
parent f0c5384d4a
commit 8fd5b3ed67
75 changed files with 1459 additions and 658 deletions

View File

@ -160,8 +160,10 @@ int_agg_state(PG_FUNCTION_ARGS)
PGARRAY *p = GetPGArray(state, 1);
if (!p)
elog(ERROR, "No aggregate storage");
/* internal error */
elog(ERROR, "no aggregate storage");
else if (p->items >= p->lower)
/* internal error */
elog(ERROR, "aggregate storage too small");
else
p->array[p->items++] = value;
@ -190,11 +192,13 @@ int_enum(PG_FUNCTION_ARGS)
ReturnSetInfo *rsi = (ReturnSetInfo *) fcinfo->resultinfo;
if (!rsi || !IsA(rsi, ReturnSetInfo))
elog(ERROR, "No ReturnSetInfo sent! function must be declared returning a 'setof' integer");
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("int_enum called in context that cannot accept a set")));
if (!p)
{
elog(WARNING, "No data sent");
elog(WARNING, "no data sent");
PG_RETURN_NULL();
}
@ -211,7 +215,8 @@ int_enum(PG_FUNCTION_ARGS)
pc->flags = TOASTED;
if (!pc->p)
{
elog(ERROR, "Error in toaster!!! no detoasting");
/* internal error */
elog(ERROR, "error in toaster; not detoasting");
PG_RETURN_NULL();
}
}