index 97014c1a5a5caa5e691985ca14e57794dcd3f703..8a6b6905079d427fac825a08f6ee4e8f4dc00bf7 100644 (file)
return 0; /* return value does not matter */
}
+/*
+ * errhint_internal --- add a hint error message text to the current error
+ *
+ * Non-translated version of errhint(), see also errmsg_internal().
+ */
+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 */
+}
/*
* errhint_plural --- add a hint error message text to the current error,
index 855c147325b237866d667c7e0fb2088205b2810d..a5313c5d2d5ae9f8af623f80b404cecc2ba7ada3 100644 (file)
@@ -195,6 +195,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);
extern int errhint_plural(const char *fmt_singular, const char *fmt_plural,
unsigned long n,...) pg_attribute_printf(1, 4) pg_attribute_printf(2, 4);