CHECK_STACK_DEPTH();
oldcontext = MemoryContextSwitchTo(edata->assoc_context);
+ edata->message_id = fmt;
EVALUATE_MESSAGE(edata->domain, message, false, true);
MemoryContextSwitchTo(oldcontext);
CHECK_STACK_DEPTH();
oldcontext = MemoryContextSwitchTo(edata->assoc_context);
+ edata->message_id = fmt;
EVALUATE_MESSAGE(edata->domain, message, false, false);
MemoryContextSwitchTo(oldcontext);
CHECK_STACK_DEPTH();
oldcontext = MemoryContextSwitchTo(edata->assoc_context);
+ edata->message_id = fmt_singular;
EVALUATE_MESSAGE_PLURAL(edata->domain, message, false);
MemoryContextSwitchTo(oldcontext);
recursion_depth++;
oldcontext = MemoryContextSwitchTo(edata->assoc_context);
+ edata->message_id = fmt;
EVALUATE_MESSAGE(edata->domain, message, false, false);
MemoryContextSwitchTo(oldcontext);
oldcontext = MemoryContextSwitchTo(ErrorContext);
+ edata->message_id = fmt;
EVALUATE_MESSAGE(edata->domain, message, false, true);
MemoryContextSwitchTo(oldcontext);
* where it would have much less information available. emit_log_hook is
* intended for custom log filtering and custom log message transmission
* mechanisms.
+ *
+ * The log hook has access to both the translated and original English
+ * error message text, which is passed through to allow it to be used
+ * as a message identifier. Note that the original text is not available
+ * for detail, detail_log, hint and context text elements.
*/
if (edata->output_to_server && emit_log_hook)
(*emit_log_hook) (edata);
const char *domain; /* message domain */
const char *context_domain; /* message domain for context message */
int sqlerrcode; /* encoded ERRSTATE */
- char *message; /* primary error message */
+ char *message; /* primary error message (translated) */
char *detail; /* detail error message */
char *detail_log; /* detail error message for server log only */
char *hint; /* hint message */
char *context; /* context message */
+ const char *message_id; /* message id of .message (original English text) */
char *schema_name; /* name of schema */
char *table_name; /* name of table */
char *column_name; /* name of column */