]> git.openstreetmap.org Git - nominatim.git/blobdiff - utils/update.php
Merge pull request #1898 from lonvia/show-housenumber-with-housename
[nominatim.git] / utils / update.php
index d03cbed6b8e32029bdc6ccd4be353d1bb92c9ec9..cba58d3119180009b8b12a00d83ef48d659c1d53 100644 (file)
@@ -55,6 +55,7 @@ date_default_timezone_set('Etc/UTC');
 
 $oDB = new Nominatim\DB();
 $oDB->connect();
 
 $oDB = new Nominatim\DB();
 $oDB->connect();
+$fPostgresVersion = $oDB->getPostgresVersion();
 
 $aDSNInfo = Nominatim\DB::parseDSN(CONST_Database_DSN);
 if (!isset($aDSNInfo['port']) || !$aDSNInfo['port']) $aDSNInfo['port'] = 5432;
 
 $aDSNInfo = Nominatim\DB::parseDSN(CONST_Database_DSN);
 if (!isset($aDSNInfo['port']) || !$aDSNInfo['port']) $aDSNInfo['port'] = 5432;
@@ -90,13 +91,21 @@ if (isset($aDSNInfo['password']) && $aDSNInfo['password']) {
 if (!is_null(CONST_Osm2pgsql_Flatnode_File) && CONST_Osm2pgsql_Flatnode_File) {
     $oOsm2pgsqlCmd->addParams('--flat-nodes', CONST_Osm2pgsql_Flatnode_File);
 }
 if (!is_null(CONST_Osm2pgsql_Flatnode_File) && CONST_Osm2pgsql_Flatnode_File) {
     $oOsm2pgsqlCmd->addParams('--flat-nodes', CONST_Osm2pgsql_Flatnode_File);
 }
+if ($fPostgresVersion >= 11.0) {
+    $oOsm2pgsqlCmd->addEnvPair(
+        'PGOPTIONS',
+        '-c jit=off -c max_parallel_workers_per_gather=0'
+    );
+}
 
 
 $oIndexCmd = (new \Nominatim\Shell(CONST_BasePath.'/nominatim/nominatim.py'))
              ->addParams('--database', $aDSNInfo['database'])
              ->addParams('--port', $aDSNInfo['port'])
              ->addParams('--threads', $aResult['index-instances']);
 
 
 $oIndexCmd = (new \Nominatim\Shell(CONST_BasePath.'/nominatim/nominatim.py'))
              ->addParams('--database', $aDSNInfo['database'])
              ->addParams('--port', $aDSNInfo['port'])
              ->addParams('--threads', $aResult['index-instances']);
-
+if (!$aResult['quiet']) {
+    $oIndexCmd->addParams('--verbose');
+}
 if ($aResult['verbose']) {
     $oIndexCmd->addParams('--verbose');
 }
 if ($aResult['verbose']) {
     $oIndexCmd->addParams('--verbose');
 }
@@ -144,7 +153,6 @@ if ($aResult['init-updates']) {
                                       'enable-diff-updates' => true,
                                       'verbose' => $aResult['verbose']
                                      ));
                                       'enable-diff-updates' => true,
                                       'verbose' => $aResult['verbose']
                                      ));
-        $cSetup->connect();
         $cSetup->createFunctions();
     }
 
         $cSetup->createFunctions();
     }