Skip to content

Commit fa75ae4

Browse files
committed
initdb parameter modified for pg_upgrade
1 parent e7d7812 commit fa75ae4

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

major_upgrade/pg_upgrade.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ def pg_upgrade(self, check=False):
187187

188188
def prepare_new_pgdata(self, version):
189189
from spilo_commons import append_extensions
190-
191-
locale = self.query('SHOW lc_collate')[0][0]
192-
encoding = self.query('SHOW server_encoding')[0][0]
193-
initdb_config = [{'locale': locale}, {'encoding': encoding}]
190+
191+
locale = self.query("SELECT datcollate FROM pg_database WHERE datname = 'template1'")[0][0]
192+
# encoding = self.query('SHOW server_encoding')[0][0]
193+
initdb_config = [{'locale': locale}, {'locale-provider': 'icu'}]
194194
if self.query("SELECT current_setting('data_checksums')::bool")[0][0]:
195195
initdb_config.append('data-checksums')
196196

scripts/configure_spilo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ def deep_update(a, b):
255255
--port={{CLONE_PORT}} --user="{{CLONE_USER}}"
256256
{{/CLONE_WITH_BASEBACKUP}}
257257
initdb:
258-
- encoding: UTF8
259258
- locale: {{INITDB_LOCALE}}.UTF-8
260259
- data-checksums
261260
- locale-provider: icu

0 commit comments

Comments
 (0)