Skip to content

Commit 8a6d60f

Browse files
committed
Quotes in strings injected into bki file need to escaped. In particular,
"People's Republic of China" locale on Windows was causing initdb to fail. This fixes bug #5818 reported by yulei. On master, this makes the mapping of "People's Republic of China" to just "China" obsolete. In 9.0 and 8.4, just fix the escaping. Earlier versions didn't have locale names in bki file.
1 parent ebcbc8c commit 8a6d60f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bin/initdb/initdb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,9 +1313,9 @@ bootstrap_template1(void)
13131313

13141314
bki_lines = replace_token(bki_lines, "ENCODING", encodingid);
13151315

1316-
bki_lines = replace_token(bki_lines, "LC_COLLATE", lc_collate);
1316+
bki_lines = replace_token(bki_lines, "LC_COLLATE", escape_quotes(lc_collate));
13171317

1318-
bki_lines = replace_token(bki_lines, "LC_CTYPE", lc_ctype);
1318+
bki_lines = replace_token(bki_lines, "LC_CTYPE", escape_quotes(lc_ctype));
13191319

13201320
/*
13211321
* Pass correct LC_xxx environment to bootstrap.

0 commit comments

Comments
 (0)