From 446a5a95bc9ce401d7cf2afffc091aa36b9c2307 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Tue, 18 Apr 2017 22:29:21 +0200 Subject: [PATCH] get pg error on correct connection --- utils/setup.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/utils/setup.php b/utils/setup.php index 57a2de16..c25dc094 100755 --- a/utils/setup.php +++ b/utils/setup.php @@ -369,7 +369,9 @@ if ($aCMDResult['load-data'] || $aCMDResult['all']) { $sSQL .= 'select * from place where osm_id % '.$iLoadThreads.' = '.$i; $sSQL .= " and not (class='place' and type='houses' and osm_type='W' and ST_GeometryType(geometry) = 'ST_LineString')"; if ($aCMDResult['verbose']) echo "$sSQL\n"; - if (!pg_send_query($aDBInstances[$i]->connection, $sSQL)) fail(pg_last_error($oDB->connection)); + if (!pg_send_query($aDBInstances[$i]->connection, $sSQL)) { + fail(pg_last_error($aDBInstances[$i]->connection)); + } } // last thread for interpolation lines $aDBInstances[$iLoadThreads] =& getDB(true); @@ -378,7 +380,9 @@ if ($aCMDResult['load-data'] || $aCMDResult['all']) { $sSQL .= ' SELECT osm_id, address, geometry from place where '; $sSQL .= "class='place' and type='houses' and osm_type='W' and ST_GeometryType(geometry) = 'ST_LineString'"; if ($aCMDResult['verbose']) echo "$sSQL\n"; - if (!pg_send_query($aDBInstances[$iLoadThreads]->connection, $sSQL)) fail(pg_last_error($oDB->connection)); + if (!pg_send_query($aDBInstances[$iLoadThreads]->connection, $sSQL)) { + fail(pg_last_error($aDBInstances[$iLoadThreads]->->connection)); + } $bAnyBusy = true; while ($bAnyBusy) { -- 2.45.1