postgresql/src/backend/utils
Tom Lane 8d32717b6b Avoid doing encoding conversions by double-conversion via MULE_INTERNAL.
Previously, we did many conversions for Cyrillic and Central European
single-byte encodings by converting to a related MULE_INTERNAL coding
scheme before converting to the destination.  This seems unnecessarily
inefficient.  Moreover, if the conversion encounters an untranslatable
character, the error message will confusingly complain about failure
to convert to or from MULE_INTERNAL, rather than the user-visible
encodings.  Worse still, this approach results in some completely
unnecessary conversion failures; there are cases where the chosen
MULE subset lacks characters that exist in both of the user-visible
encodings, causing a conversion failure that need not occur.

This patch fixes the first two of those deficiencies by introducing
a new local2local() conversion support subroutine for direct conversion
between any two single-byte character sets, and adding new conversion
tables where needed.  However, I generated the new conversion tables by
testing PG 9.5's behavior, so that the actual conversion behavior is
bug-compatible with previous releases; the only user-visible behavior
change is that the error messages for conversion failures are saner.
Changes in the conversion behavior will probably ensue after discussion.

Interestingly, although this approach requires more tables, the .so files
actually end up smaller (at least on my x86_64 machine); the tables are
smaller than the management code needed for double conversion.

Per a complaint from Albe Laurenz.
2015-11-28 13:42:27 -05:00
..
adt Improve div_var_fast(), mostly by making comments better. 2015-11-25 16:05:57 -05:00
cache Be more noisy about "wrong number of nailed relations" initfile problems. 2015-11-11 13:39:21 -05:00
error Coordinate log_line_prefix options 'm' and 'n' to share a timeval. 2015-09-07 15:40:49 -07:00
fmgr pgindent run for 9.5 2015-05-23 21:35:49 -04:00
hash Remove volatile qualifiers from dynahash.c, shmem.c, and sinvaladt.c 2015-10-16 14:14:15 -04:00
init Perform an immediate shutdown if the postmaster.pid file is removed. 2015-10-06 17:15:52 -04:00
mb Avoid doing encoding conversions by double-conversion via MULE_INTERNAL. 2015-11-28 13:42:27 -05:00
misc Message improvements 2015-11-16 21:39:23 -05:00
mmgr Fix subtransaction cleanup after an outer-subtransaction portal fails. 2015-09-04 13:37:14 -04:00
resowner Update copyright for 2015 2015-01-06 11:43:47 -05:00
sort Improve comments about abbreviation abort. 2015-11-03 14:11:49 -05:00
time Fix failure to consider failure cases in GetComboCommandId(). 2015-11-26 13:23:02 -05:00
.gitignore Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
errcodes.txt Redesign tablesample method API, and do extensive code review. 2015-07-25 14:39:00 -04:00
Gen_dummy_probes.sed Update copyright for 2015 2015-01-06 11:43:47 -05:00
Gen_fmgrtab.pl Allow forcing nullness of columns during bootstrap. 2015-02-21 22:31:54 +01:00
generate-errcodes.pl Update copyright for 2015 2015-01-06 11:43:47 -05:00
Makefile Make handling of errcodes.h more consistent with other generated headers. 2011-02-04 09:29:10 -05:00
probes.d Update copyright for 2015 2015-01-06 11:43:47 -05:00