]> git.openstreetmap.org Git - nominatim.git/blobdiff - utils/setup.php
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / utils / setup.php
index eeba0a28e23ac79d1bedae806e6533c6a680ae75..7490d820dd212735b23aa5270a70efd39753a9d6 100755 (executable)
@@ -407,9 +407,13 @@ if ($aCMDResult['load-data'] || $aCMDResult['all']) {
 
     $sDatabaseDate = getDatabaseDate($oDB);
     pg_query($oDB->connection, 'TRUNCATE import_status');
-    $sSQL = "INSERT INTO import_status (lastimportdate) VALUES('".$sDatabaseDate."')";
-    pg_query($oDB->connection, $sSQL);
-    echo "Latest data imported from $sDatabaseDate.\n";
+    if ($sDatabaseDate === false) {
+        echo "WARNING: could not determine database date.\n";
+    } else {
+        $sSQL = "INSERT INTO import_status (lastimportdate) VALUES('".$sDatabaseDate."')";
+        pg_query($oDB->connection, $sSQL);
+        echo "Latest data imported from $sDatabaseDate.\n";
+    }
 }
 
 if ($aCMDResult['import-tiger-data']) {