{"record":{"id":"762c171db6eab9e0","repo":"flarum/framework","slug":"postgresql-version-version-too-low-you-need-at-least","errorCode":null,"errorMessage":"PostgreSQL version ($version) too low. You need at least PostgreSQL 10","messagePattern":"PostgreSQL version \\(\\$version\\) too low\\. You need at least PostgreSQL 10","errorType":"exception","errorClass":"RangeException","httpStatus":null,"severity":"error","filePath":"framework/core/src/Install/Steps/ConnectToDatabase.php","lineNumber":114,"sourceCode":"        ($this->store)(\n            new MariaDbConnection(\n                $pdo,\n                $config['database'],\n                $config['prefix'],\n                $config\n            )\n        );\n    }\n\n    private function pgsql(array $config): void\n    {\n        $pdo = (new PostgresConnector)->connect($config);\n\n        $version = $pdo->query('SHOW server_version')->fetchColumn();\n        $version = Str::before($version, ' ');\n\n        if (version_compare($version, DatabaseRequirements::PGSQL_MINIMUM, '<')) {\n            throw new RangeException(\"PostgreSQL version ($version) too low. You need at least PostgreSQL 10\");\n        }\n\n        ($this->store)(\n            new PostgresConnection(\n                $pdo,\n                $config['database'],\n                $config['prefix'],\n                $config\n            )\n        );\n    }\n\n    private function sqlite(array $config): void\n    {\n        if (! file_exists($config['database'])) {\n            $config['database'] = $this->basePath.'/'.$config['database'];\n        }\n","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/flarum/framework/blob/4b939f685389bfe8a380e9e28ddf305a1c66950c/framework/core/src/Install/Steps/ConnectToDatabase.php#L96-L132","documentation":"Flarum's PostgreSQL install path queries SHOW server_version, trims any suffix via Str::before($version, ' '), and throws a RangeException when it is older than DatabaseRequirements::PGSQL_MINIMUM (PostgreSQL 10). Flarum requires modern Postgres features unavailable in 9.x. The message includes the actual detected version.","triggerScenarios":"Running the installer with driver `pgsql` against a PostgreSQL 9.x server (or a server whose reported version string normalises below 10).","commonSituations":"Legacy RDS/Azure Postgres 9.6 instances; old self-hosted Postgres from distro repos; connecting to a deprecated managed instance that was never upgraded.","solutions":["Upgrade PostgreSQL to 10 or later (preferably a supported major like 14+), e.g. via pg_upgrade","Point Flarum at a newer managed PostgreSQL instance","If upgrading is impossible, choose a different supported driver (MySQL 8+/MariaDB/SQLite) for this install"],"exampleFix":"// before\n'driver' => 'pgsql', // Postgres 9.6\n// after\n'driver' => 'pgsql', // after pg_upgrade to PostgreSQL 14\n// or\n'driver' => 'mysql',","handlingStrategy":"validation","validationCode":"$v = DB::selectOne('SHOW server_version')->server_version;\nif (version_compare(Str::before($v, ' '), '10', '<')) { /* abort install */ }","typeGuard":null,"tryCatchPattern":"try { $step->run($dbConfig); } catch (RangeException $e) { report($e); show('PostgreSQL 10+ required'); }","preventionTips":["Upgrade EOL managed Postgres instances (RDS/Azure 9.6 -> 12+)","Run pg_upgrade as part of environment modernisation","Prefer currently supported Postgres majors (12+)"],"tags":["database","postgresql","version-check","installation"],"backgroundTag":"value-out-of-range","analyzedSha":"4b939f685389bfe8a380e9e28ddf305a1c66950c","analyzedAt":"2026-09-15T18:09:20.879Z","contentChangedAt":"2026-09-15T18:09:20.879Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}