diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 079220c..89cf0e3 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -2749,12 +2749,12 @@ quickdie(SIGNAL_ARGS) */ ereport(WARNING, (errcode(ERRCODE_CRASH_SHUTDOWN), - errmsg("terminating connection because of crash of another server process"), - errdetail("The postmaster has commanded this server process to roll back" + errmsg_internal("terminating connection because of crash of another server process"), + errdetail_internal("The postmaster has commanded this server process to roll back" " the current transaction and exit, because another" " server process exited abnormally and possibly corrupted" " shared memory."), - errhint("In a moment you should be able to reconnect to the" + errhint_internal("In a moment you should be able to reconnect to the" " database and repeat your command."))); /* diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c index a7ca41d..781ef54 100644 --- a/src/backend/utils/error/elog.c +++ b/src/backend/utils/error/elog.c @@ -1022,6 +1022,27 @@ errhint(const char *fmt,...) /* + * errhint_internal --- same as errhint but not translate message + */ +int +errhint_internal(const char *fmt,...) +{ + ErrorData *edata = &errordata[errordata_stack_depth]; + MemoryContext oldcontext; + + recursion_depth++; + CHECK_STACK_DEPTH(); + oldcontext = MemoryContextSwitchTo(edata->assoc_context); + + EVALUATE_MESSAGE(edata->domain, hint, false, false); + + MemoryContextSwitchTo(oldcontext); + recursion_depth--; + return 0; /* return value does not matter */ +} + + +/* * errcontext_msg --- add a context error message text to the current error * * Unlike other cases, multiple calls are allowed to build up a stack of diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h index 3b8c1d0..075859d 100644 --- a/src/include/utils/elog.h +++ b/src/include/utils/elog.h @@ -152,6 +152,7 @@ extern int errdetail_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(1, 4) pg_attribute_printf(2, 4); extern int errhint(const char *fmt,...) pg_attribute_printf(1, 2); +extern int errhint_internal(const char *fmt,...) pg_attribute_printf(1, 2); /* * errcontext() is typically called in error context callback functions, not