- if (!pg_query($this->oDB->connection, $sSQL)) {
- fail(pg_last_error($this->oDB->connection));
- }
-
- if (CONST_Use_Extra_US_Postcodes) {
- // only add postcodes that are not yet available in OSM
- $sSQL = 'INSERT INTO location_postcode';
- $sSQL .= ' (place_id, indexed_status, country_code, postcode, geometry) ';
- $sSQL .= "SELECT nextval('seq_place'), 1, 'us', postcode,";
- $sSQL .= ' ST_SetSRID(ST_Point(x,y),4326)';
- $sSQL .= ' FROM us_postcode WHERE postcode NOT IN';
- $sSQL .= ' (SELECT postcode FROM location_postcode';
- $sSQL .= " WHERE country_code = 'us')";
- if (!pg_query($this->oDB->connection, $sSQL)) fail(pg_last_error($this->oDB->connection));
- }
+ // only add postcodes that are not yet available in OSM
+ $sSQL = 'INSERT INTO location_postcode';
+ $sSQL .= ' (place_id, indexed_status, country_code, postcode, geometry) ';
+ $sSQL .= "SELECT nextval('seq_place'), 1, 'us', postcode,";
+ $sSQL .= ' ST_SetSRID(ST_Point(x,y),4326)';
+ $sSQL .= ' FROM us_postcode WHERE postcode NOT IN';
+ $sSQL .= ' (SELECT postcode FROM location_postcode';
+ $sSQL .= " WHERE country_code = 'us')";
+ $this->oDB->exec($sSQL);