Fix SetClientEncoding() to maintain a cache of previously selected encoding
commitb922e417660fa37ed9f2b90edf9a6d59c1b3455e
authortgl <tgl>
Thu, 2 Apr 2009 17:30:53 +0000 (2 17:30 +0000)
committertgl <tgl>
Thu, 2 Apr 2009 17:30:53 +0000 (2 17:30 +0000)
tree2c415328e640428ff845e6854fc89b045ad1f96a
parent521236510efb8b647a8fbeb5894140a12eed3c1a
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.
src/backend/utils/mb/mbutils.c
src/include/mb/pg_wchar.h