Fix CREATE DATABASE when template0 has ICU rules.

Most fields, when not specified by the CREATE DATABASE command, are
simply copied from the template. But when the template has ICU rules,
and the new database uses a different provider (which is only possible
with template0), then we should ignore the ICU rules from the
template. But after commit 2d819a08a1, it tried to copy the ICU rules,
and the command resulted in an error.

This commit restores the prior behavior, which ignores the ICU rules
from the template if the new provider is not ICU.

Author: shihao zhong <[email protected]>
Reported-by: Heikki Linnakangas <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 17

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/11910736bf19c806ee55ff5d5d801dbb60bbcdce

Modified Files
--------------
src/backend/commands/dbcommands.c |  2 +-
src/test/icu/t/010_database.pl    | 44 +++++++++++++++++++++++++++++++++++++++
2 files changed, 45 insertions(+), 1 deletion(-)

Reply via email to