$OpenBSD: patch-server_src_storage_dbconfigpostgresql_cpp,v 1.4 2017/05/22 19:38:59 espie Exp $
Index: server/src/storage/dbconfigpostgresql.cpp
--- server/src/storage/dbconfigpostgresql.cpp.orig
+++ server/src/storage/dbconfigpostgresql.cpp
@@ -218,9 +218,14 @@ void DbConfigPostgresql::startInternalServer()
     // call 'initdb --pgdata=/home/user/.local/share/akonadi/data_db'
     const QString command = QString::fromLatin1( "%1" ).arg( mInitDbPath );
     QStringList arguments;
-    arguments << QString::fromLatin1( "--pgdata=%2" ).arg( mPgData )
-              // TODO check locale
-              << QString::fromLatin1( "--locale=en_US.UTF-8" );
+    arguments << QString::fromLatin1( "--pgdata=%2" ).arg( mPgData );
+#if defined(__OpenBSD__)
+    // Not full locale support, PostgreSQL bails out with non-C locale
+    arguments << QString::fromLatin1( "--locale=C" );
+#else
+    // TODO check locale
+    arguments << QString::fromLatin1( "--locale=en_US.UTF-8" );
+#endif
     QProcess::execute( command, arguments );
   }
 
