mirror of
https://github.com/postgres/postgres.git
synced 2025-11-04 20:11:56 +03:00
Show PIDs of lock holders and waiters in log_lock_waits log message.
Christian Kruse, reviewed by Kumar Rajeev Rastogi.
This commit is contained in:
@@ -937,6 +937,28 @@ errdetail_log(const char *fmt,...)
|
||||
return 0; /* return value does not matter */
|
||||
}
|
||||
|
||||
/*
|
||||
* errdetail_log_plural --- add a detail_log error message text to the current error
|
||||
* with support for pluralization of the message text
|
||||
*/
|
||||
int
|
||||
errdetail_log_plural(const char *fmt_singular, const char *fmt_plural,
|
||||
unsigned long n,...)
|
||||
{
|
||||
ErrorData *edata = &errordata[errordata_stack_depth];
|
||||
MemoryContext oldcontext;
|
||||
|
||||
recursion_depth++;
|
||||
CHECK_STACK_DEPTH();
|
||||
oldcontext = MemoryContextSwitchTo(edata->assoc_context);
|
||||
|
||||
EVALUATE_MESSAGE_PLURAL(edata->domain, detail_log, false);
|
||||
|
||||
MemoryContextSwitchTo(oldcontext);
|
||||
recursion_depth--;
|
||||
return 0; /* return value does not matter */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* errdetail_plural --- add a detail error message text to the current error,
|
||||
|
||||
Reference in New Issue
Block a user