File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
postgres-appliance/major_upgrade Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -207,8 +207,9 @@ def prepare_new_pgdata(self, version):
207207 locale = self .query ("SELECT datcollate FROM pg_database WHERE datname='template1';" )[0 ][0 ]
208208 encoding = self .query ('SHOW server_encoding' )[0 ][0 ]
209209 initdb_config = [{'locale' : locale }, {'encoding' : encoding }]
210- if self .query ("SELECT current_setting('data_checksums')::bool" )[0 ][0 ]:
211- initdb_config .append ('data-checksums' )
210+ checksums_enabled = self .query ("SELECT current_setting('data_checksums')::bool" )[0 ][0 ]
211+ if checksums_enabled == (int (version ) < 18 ):
212+ initdb_config .append ('data-checksums' if checksums_enabled else 'no-data-checksums' )
212213
213214 logger .info ('initdb config: %s' , initdb_config )
214215
You can’t perform that action at this time.
0 commit comments