summaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
authorFujii Masao2014-03-12 18:26:47 +0000
committerFujii Masao2014-03-12 18:26:47 +0000
commit588fb5071545ce6e8ffb6a88e146789560e6c879 (patch)
tree6dd0f34e13b25ac3f8431aefafae4fa21502b81d /src/backend/utils
parenta0b4c355c2f4e26735d28372c49f4661621988f2 (diff)
Show PIDs of lock holders and waiters in log_lock_waits log message.
Christian Kruse, reviewed by Kumar Rajeev Rastogi.
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/error/elog.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index 8705586d565..d28b7494115 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -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,