Commit 8bed6655 authored by Sandro Knauß's avatar Sandro Knauß
Browse files

Refactor(postgres): Use everywhere the same initdb function.

parent 72bd55f8
Pipeline #33441 failed with stage
in 89 minutes and 49 seconds
......@@ -483,18 +483,7 @@ bool DbConfigPostgresql::startInternalServer()
// postgres data directory not initialized yet, so call initdb on it
if (!QFile::exists(QStringLiteral("%1/PG_VERSION").arg(mPgData))) {
#ifdef Q_OS_LINUX
// It is recommended to disable CoW feature when running on Btrfs to improve
// database performance. This only has effect when done on an empty directory,
// so we call this before calling initdb.
if (Utils::getDirectoryFileSystem(mPgData) == QLatin1String("btrfs")) {
// call 'initdb --pgdata=/home/user/.local/share/akonadi/db_data'
execute(mInitDbPath, { QStringLiteral("--pgdata=%1").arg(mPgData),
QStringLiteral("--locale=en_US.UTF-8") // TODO: check locale
} else {
const auto versions = checkPgVersion();
if (versions.has_value() && (versions->clusterVersion < versions->pgServerVersion)) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment