pg_upgrade: copy locale and encoding information to new cluster.
authorJeff Davis <jdavis@postgresql.org>
Thu, 9 Mar 2023 16:28:05 +0000 (08:28 -0800)
committerJeff Davis <jdavis@postgresql.org>
Thu, 9 Mar 2023 16:28:05 +0000 (08:28 -0800)
commit9637badd9f9209166140eb567602e91699dd2ffb
tree2d46a9b14c83d5b163dbd82eb8fe8fe9e341cd7c
parent8dff2f224f4f49ddd4f45f590e7f46b160a4951b
pg_upgrade: copy locale and encoding information to new cluster.

Previously, pg_upgrade checked that the old and new clusters were
compatible, including the locale and encoding. But the new cluster was
just created, and only template0 from the new cluster will be
preserved (template1 and postgres are both recreated during the
upgrade process).

Because template0 is not sensitive to locale or encoding, just update
the pg_database entry to be the same as template0 from the original
cluster.

This commit makes it easier to change the default initdb locale or
encoding settings without causing needless incompatibilities.

Discussion: https://postgr.es/m/d62b2874-729b-d26a-2d0a-0d64f509eca4@enterprisedb.com
Reviewed-by: Peter Eisentraut
src/bin/pg_upgrade/Makefile
src/bin/pg_upgrade/check.c
src/bin/pg_upgrade/info.c
src/bin/pg_upgrade/meson.build
src/bin/pg_upgrade/pg_upgrade.c
src/bin/pg_upgrade/pg_upgrade.h
src/bin/pg_upgrade/t/002_pg_upgrade.pl