From 3e86678ffea8595d10e984fcf659d474cc7092ed Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 27 Oct 2008 19:37:36 +0000 Subject: Install a more robust solution for the problem of infinite error-processing recursion when we are unable to convert a localized error message to the client's encoding. We've been over this ground before, but as reported by Ibrar Ahmed, it still didn't work in the case of conversion failures for the conversion-failure message itself :-(. Fix by installing a "circuit breaker" that disables attempts to localize this message once we get into recursion trouble. Patch all supported branches, because it is in fact broken in all of them; though I had to add some missing translations to the older branches in order to expose the failure in the particular test case I was using. --- src/include/utils/elog.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/include/utils/elog.h') diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h index 707bc5b2fda..e0000f6ceb5 100644 --- a/src/include/utils/elog.h +++ b/src/include/utils/elog.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/elog.h,v 1.82.2.1 2008/04/17 00:00:01 tgl Exp $ + * $PostgreSQL: pgsql/src/include/utils/elog.h,v 1.82.2.2 2008/10/27 19:37:36 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -289,6 +289,7 @@ extern int Log_destination; /* Other exported functions */ extern void DebugFileOpen(void); extern char *unpack_sql_state(int sql_state); +extern bool in_error_recursion_trouble(void); #ifdef HAVE_SYSLOG extern void set_syslog_parameters(const char *ident, int facility); -- cgit v1.2.3