summaryrefslogtreecommitdiff
path: root/src/bin/initdb/initdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/initdb/initdb.c')
-rw-r--r--src/bin/initdb/initdb.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index d509b1311d1..98e864d5495 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -1616,17 +1616,21 @@ setup_collation(void)
*/
skip = false;
for (i = 0; i < len; i++)
+ {
if (IS_HIGHBIT_SET(localebuf[i]))
{
- if (debug)
- fprintf(stderr, _("%s: locale name has non-ASCII characters, skipped: %s\n"),
- progname, localebuf);
- skipped++;
skip = true;
break;
}
+ }
if (skip)
+ {
+ if (debug)
+ fprintf(stderr, _("%s: locale name has non-ASCII characters, skipped: %s\n"),
+ progname, localebuf);
+ skipped++;
continue;
+ }
enc = pg_get_encoding_from_locale(localebuf, debug);
if (enc < 0)
@@ -1635,7 +1639,7 @@ setup_collation(void)
continue; /* error message printed by pg_get_encoding_from_locale() */
}
if (enc == PG_SQL_ASCII)
- continue; /* SQL_ASCII is handled separately */
+ continue; /* C/POSIX are already in the catalog */
PG_CMD_PRINTF2("INSERT INTO tmp_pg_collation (locale, encoding) VALUES ('%s', %d);",
escape_quotes(localebuf), enc);
@@ -1651,10 +1655,6 @@ setup_collation(void)
escape_quotes(alias), escape_quotes(localebuf), enc);
}
- for (i = PG_SQL_ASCII; i <= PG_ENCODING_BE_LAST; i++)
- PG_CMD_PRINTF2("INSERT INTO tmp_pg_collation (locale, encoding) VALUES ('C', %d), ('POSIX', %d);",
- i, i);
-
/* Add an SQL-standard name */
PG_CMD_PRINTF1("INSERT INTO tmp_pg_collation (collname, locale, encoding) VALUES ('ucs_basic', 'C', %d);", PG_UTF8);