File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -340,9 +340,13 @@ private String getCreateDatabaseCommand(PostgresGlobalState state) {
340340 sb .append (Randomly .fromOptions ("utf8" ));
341341 sb .append ("' " );
342342 }
343- for (String lc : Arrays .asList ("LC_COLLATE" , "LC_CTYPE" )) {
344- if (!state .getCollates ().isEmpty () && Randomly .getBoolean ()) {
345- sb .append (String .format (" %s = '%s'" , lc , Randomly .fromList (state .getCollates ())));
343+ if (Randomly .getBoolean () && !state .getCollates ().isEmpty ()) {
344+ sb .append (String .format (" LOCALE = '%s' " , Randomly .fromList (state .getCollates ())));
345+ } else {
346+ for (String lc : Arrays .asList ("LC_COLLATE" , "LC_CTYPE" )) {
347+ if (!state .getCollates ().isEmpty () && Randomly .getBoolean ()) {
348+ sb .append (String .format (" %s = '%s'" , lc , Randomly .fromList (state .getCollates ())));
349+ }
346350 }
347351 }
348352 sb .append (" TEMPLATE template0" );
You can’t perform that action at this time.
0 commit comments