1 diff -u -r ../postgresql-9.6.2/src/bin/initdb/initdb.c ./src/bin/initdb/initdb.c
2 --- ../postgresql-9.6.2/src/bin/initdb/initdb.c 2017-02-06 22:45:25.000000000 +0100
3 +++ ./src/bin/initdb/initdb.c 2017-03-05 14:41:04.690265407 +0100
6 /* values to be obtained from arguments */
7 static char *pg_data = "";
8 -static char *encoding = "";
9 -static char *locale = "";
10 +static char *encoding = "UTF-8";
11 +static char *locale = "en_US.UTF-8";
12 static char *lc_collate = "";
13 static char *lc_ctype = "";
14 static char *lc_monetary = "";
16 setup_collation(FILE *cmdfd)
18 #if defined(HAVE_LOCALE_T) && !defined(WIN32)
21 FILE *locale_a_handle;
22 char localebuf[NAMEDATALEN]; /* we assume ASCII so this is fine */
23 @@ -1856,12 +1857,14 @@
24 locale_a_handle = popen_check("locale -a", "r");
26 return; /* complaint already printed */
29 PG_CMD_PUTS("CREATE TEMP TABLE tmp_pg_collation ( "
32 " encoding int) WITHOUT OIDS;\n\n");
35 while (fgets(localebuf, sizeof(localebuf), locale_a_handle))
44 /* Add an SQL-standard name */
45 PG_CMD_PRINTF1("INSERT INTO tmp_pg_collation VALUES ('ucs_basic', 'C', %d);\n\n", PG_UTF8);
48 PG_CMD_PUTS("DROP TABLE tmp_pg_collation;\n\n");
51 pclose(locale_a_handle);
53 if (count == 0 && !debug)
55 printf(_("No usable system locales were found.\n"));
56 printf(_("Use the option \"--debug\" to see details.\n"));
59 #endif /* not HAVE_LOCALE_T && not WIN32 */