Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id DFA4C633768 for ; Thu, 2 Apr 2009 14:30:56 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 39738-09 for ; Thu, 2 Apr 2009 14:30:52 -0300 (ADT) Received: from cvs.postgresql.org (cvs.postgresql.org [217.196.146.206]) by mail.postgresql.org (Postfix) with ESMTP id A953C632F9B for ; Thu, 2 Apr 2009 14:30:54 -0300 (ADT) Received: by cvs.postgresql.org (Postfix, from userid 1007) id CCF96754ADE; Thu, 2 Apr 2009 17:30:53 +0000 (UTC) MIME-Version: 1.0 To: pgsql-committers@postgresql.org Subject: pgsql: Fix SetClientEncoding() to maintain a cache of previously X-Mailer: activitymail 1.24, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain Message-Id: <20090402173053.CCF96754ADE@cvs.postgresql.org> Date: Thu, 2 Apr 2009 17:30:53 +0000 (UTC) From: tgl@postgresql.org (Tom Lane) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/16 X-Sequence-Number: 36510 Log Message: ----------- Fix SetClientEncoding() to maintain a cache of previously selected encoding conversion functions. This allows transaction rollback to revert to a previous client_encoding setting without doing fresh catalog lookups. I believe that this explains and fixes the recent report of "failed to commit client_encoding" failures. This bug is present in 8.3.x, but it doesn't seem prudent to back-patch the fix, at least not till it's had some time for field testing in HEAD. In passing, remove SetDefaultClientEncoding(), which was used nowhere. Modified Files: -------------- pgsql/src/backend/utils/mb: mbutils.c (r1.82 -> r1.83) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/mb/mbutils.c?r1=1.82&r2=1.83) pgsql/src/include/mb: pg_wchar.h (r1.87 -> r1.88) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/mb/pg_wchar.h?r1=1.87&r2=1.88)