X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/0628aa887fb8b0b367fa8aacb4d4473661b77fa5..67b6f6350d783d2078274e26b07136b37ea20f46:/utils/setup.php?ds=sidebyside diff --git a/utils/setup.php b/utils/setup.php index eeba0a28..7490d820 100755 --- a/utils/setup.php +++ b/utils/setup.php @@ -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']) {