postgresql/contrib/pg_upgrade
Heikki Linnakangas 33755e8edf Change the way encoding and locale checks are done in pg_upgrade.
Lc_collate and lc_ctype have been per-database settings since server version
8.4, but pg_upgrade was still treating them as cluster-wide options. It
fetched the values for the template0 databases in old and new cluster, and
compared them. That's backwards; the encoding and locale of the template0
database doesn't matter, as template0 is guaranteed to contain only ASCII
characters. But if there are any other databases that exist on both clusters
(in particular template1 and postgres databases), their encodings and
locales must be compatible.

Also, make the locale comparison more lenient. If the locale names are not
equal, try to canonicalize both of them by passing them to setlocale(). We
used to do that only when upgrading from 9.1 or below, but it seems like a
good idea even with newer versions. If we change the canonical form of a
locale, this allows pg_upgrade to still work. I'm about to do just that to
fix bug #11431, by mapping a locale name that contains non-ASCII characters
to a pure-ASCII alias of the same locale.

No backpatching, because earlier versions of pg_upgrade still support
upgrading from 8.3 servers. That would be more complicated, so it doesn't
seem worth it, given that we haven't received any complaints about this
from users.
2014-10-10 10:39:32 +03:00
..
.gitignore pg_upgrade: Add new generated file to .gitignore 2012-03-20 20:40:31 +02:00
check.c Change the way encoding and locale checks are done in pg_upgrade. 2014-10-10 10:39:32 +03:00
controldata.c Change the way encoding and locale checks are done in pg_upgrade. 2014-10-10 10:39:32 +03:00
dump.c revert "Throw error for ALTER TABLE RESET of an invalid option" 2014-08-25 20:07:37 -04:00
exec.c pg_upgrade: update C comments about pg_dumpall 2014-06-30 19:56:23 -04:00
file.c pgindent run for 9.4 2014-05-06 12:12:18 -04:00
function.c pg_upgrade: update C comments about pg_dumpall 2014-06-30 19:56:23 -04:00
IMPLEMENTATION Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
info.c Change the way encoding and locale checks are done in pg_upgrade. 2014-10-10 10:39:32 +03:00
Makefile pg_upgrade: remove support for 8.3 old clusters 2014-08-25 20:05:07 -04:00
option.c pg_ctl, pg_upgrade: allow multiple -o/-O options, append them 2014-08-25 16:30:26 -04:00
page.c pgindent run for 9.4 2014-05-06 12:12:18 -04:00
parallel.c pgindent run for 9.4 2014-05-06 12:12:18 -04:00
pg_upgrade.c pg_upgrade: preserve the timestamp epoch 2014-09-05 19:19:41 -04:00
pg_upgrade.h Change the way encoding and locale checks are done in pg_upgrade. 2014-10-10 10:39:32 +03:00
relfilenode.c pgindent run for 9.4 2014-05-06 12:12:18 -04:00
server.c pg_upgrade: adjust logging to use QUERY_ALLOC lengths 2014-08-20 13:04:45 -04:00
tablespace.c pgindent run for 9.4 2014-05-06 12:12:18 -04:00
test.sh Fix contrib/pg_upgrade/test.sh for $PWD containing spaces. 2014-06-19 21:47:08 -04:00
TESTING Rename 'gmake' to 'make' in docs and recommended commands 2014-02-12 17:29:19 -05:00
util.c pg_upgrade: adjust logging to use QUERY_ALLOC lengths 2014-08-20 13:04:45 -04:00
version.c Fix whitespace 2014-05-15 13:23:31 -04:00