<?php
require_once('DB.php');
- function &getDB($bNew = false)
+ function &getDB($bNew = false, $bPersistent = false)
{
// Get the database object
- $oDB =& DB::connect(CONST_Database_DSN.($bNew?'?new_link=true':''), false);
+ $oDB =& DB::connect(CONST_Database_DSN.($bNew?'?new_link=true':''), $bPersistent);
if (PEAR::IsError($oDB))
{
var_dump(CONST_Database_DSN);
PQclear(resPlaces);
exit(EXIT_FAILURE);
}
- if (PQftype(resPlaces, 0) != PG_OID_INT4)
+ if (PQftype(resPlaces, 0) != PG_OID_INT8)
{
fprintf(stderr, "Place_id value has unexpected type\n");
PQclear(resPlaces);
tuples = PQntuples(resPlaces);
for (i = 0; i < tuples; i++)
{
- nominatim_exportPlace(PGint32(*((uint32_t *)PQgetvalue(resPlaces, i, 0))), conn, writer, NULL, NULL);
+ nominatim_exportPlace(PGint64(*((uint64_t *)PQgetvalue(resPlaces, i, 0))), conn, writer, NULL, NULL);
rankTotalDone++;
if (rankTotalDone%1000 == 0) printf("Done %i (k)\n", rankTotalDone/1000);
}
char featureNameString[MAX_FEATURENAMESTRING];
char featureExtraTagString[MAX_FEATUREEXTRATAGSTRING];
+extern int verbose;
+
void StartElement(xmlTextReaderPtr reader, const xmlChar *name)
{
char * value;
if (fileMode == FILEMODE_UPDATE || fileMode == FILEMODE_DELETE || fileMode == FILEMODE_ADD)
{
paramValues[0] = (const char *)place_id;
+ if (verbose) fprintf(stderr, "placex_delete: %s\n", paramValues[0]);
res = PQexecPrepared(conn, "placex_delete", 1, paramValues, NULL, NULL, 0);
if (PQresultStatus(res) != PGRES_COMMAND_OK)
{
}
PQclear(res);
+ if (verbose) fprintf(stderr, "search_name_delete: %s\n", paramValues[0]);
res = PQexecPrepared(conn, "search_name_delete", 1, paramValues, NULL, NULL, 0);
if (PQresultStatus(res) != PGRES_COMMAND_OK)
{
}
PQclear(res);
+ if (verbose) fprintf(stderr, "place_addressline_delete: %s\n", paramValues[0]);
res = PQexecPrepared(conn, "place_addressline_delete", 1, paramValues, NULL, NULL, 0);
if (PQresultStatus(res) != PGRES_COMMAND_OK)
{
paramValues[13] = (const char *)feature.geometry;
if (strlen(paramValues[3]) && strlen(paramValues[13]))
{
+ if (verbose) fprintf(stderr, "placex_insert: %s\n", paramValues[0]);
res = PQexecPrepared(conn, "placex_insert", 14, paramValues, NULL, NULL, 0);
if (PQresultStatus(res) != PGRES_COMMAND_OK)
{
{
paramValues[0] = (const char *)place_id;
paramValues[1] = feature.parentPlaceID;
+ if (verbose) fprintf(stderr, "search_name_from_parent_insert: INSERT %s %s\n", paramValues[0], paramValues[1]);
res = PQexecPrepared(conn, "search_name_from_parent_insert", 2, paramValues, NULL, NULL, 0);
if (PQresultStatus(res) != PGRES_COMMAND_OK)
{
else
{
paramValues[0] = (const char *)place_id;
+ if (verbose) fprintf(stderr, "search_name_insert: INSERT %s\n", paramValues[0]);
res = PQexecPrepared(conn, "search_name_insert", 1, paramValues, NULL, NULL, 0);
if (PQresultStatus(res) != PGRES_COMMAND_OK)
{
res = PQprepare(conn, "search_name_insert",
"insert into search_name (place_id, search_rank, address_rank, country_code, name_vector, nameaddress_vector, centroid) "
"select place_id, rank_search, rank_address, country_code, make_keywords(name), "
- "(select uniq(sort(array_agg(parent_search_name.name_vector))) from place_addressline join search_name as parent_search_name on "
- "(address_place_id = parent_search_name.place_id) where place_addressline.place_id = $1 ), st_centroid(geometry) from placex "
+ "(select uniq(sort(array_agg(parent_search_name.name_vector))) from search_name as parent_search_name where place_id in "
+ "(select distinct address_place_id from place_addressline where place_addressline.place_id = $1 limit 1000)"
+ "), st_centroid(geometry) from placex "
"where place_id = $1",
1, NULL);
+
if (PQresultStatus(res) != PGRES_COMMAND_OK)
{
fprintf(stderr, "Failed to prepare search_name_insert: %s\n", PQerrorMessage(conn));
int i;
int iSector;
int iResult;
- int bSkip;
const char *paramValues[2];
int paramLengths[2];
exit(EXIT_FAILURE);
}
- pg_prepare_params[0] = PG_OID_INT4;
+ pg_prepare_params[0] = PG_OID_INT8;
res = PQprepare(thread_data[i].conn, "index_placex",
"update placex set indexed_status = 0 where place_id = $1",
1, pg_prepare_params);
PQclear(resPlaces);
exit(EXIT_FAILURE);
}
- if (PQftype(resPlaces, 0) != PG_OID_INT4)
+ if (PQftype(resPlaces, 0) != PG_OID_INT8)
{
fprintf(stderr, "Place_id value has unexpected type\n");
PQclear(resPlaces);
const char *paramValues[1];
int paramLengths[1];
int paramFormats[1];
- uint32_t paramPlaceID;
- uint32_t place_id;
+ uint64_t paramPlaceID;
+ uint64_t place_id;
time_t updateStartTime;
while (1)
break;
}
- place_id = PGint32(*((uint32_t *)PQgetvalue(thread_data->res, *thread_data->count, 0)));
+ place_id = PGint64(*((uint64_t *)PQgetvalue(thread_data->res, *thread_data->count, 0)));
(*thread_data->count)++;
pthread_mutex_unlock( thread_data->count_mutex );
- if (verbose) fprintf(stderr, " Processing place_id %d\n", place_id);
+ if (verbose) fprintf(stderr, " Processing place_id %ld\n", place_id);
updateStartTime = time(0);
int done = 0;
while(!done)
{
-
- paramPlaceID = PGint32(place_id);
+ paramPlaceID = PGint64(place_id);
paramValues[0] = (char *)¶mPlaceID;
paramLengths[0] = sizeof(paramPlaceID);
paramFormats[0] = 1;
{
if (strncmp(PQerrorMessage(thread_data->conn), "ERROR: deadlock detected", 25))
{
- fprintf(stderr, "index_placex: UPDATE failed - deadlock, retrying\n");
+ fprintf(stderr, "index_placex: UPDATE failed - deadlock, retrying (%ld)\n", place_id);
PQclear(res);
sleep(rand() % 10);
}
}
}
PQclear(res);
- if (difftime(time(0), updateStartTime) > 1) fprintf(stderr, " Slow place_id %d\n", place_id);
+ if (difftime(time(0), updateStartTime) > 1) fprintf(stderr, " Slow place_id %ld\n", place_id);
if (thread_data->writer)
{
$$
LANGUAGE plpgsql IMMUTABLE;
-CREATE OR REPLACE FUNCTION delete_location(OLD_place_id INTEGER) RETURNS BOOLEAN
+CREATE OR REPLACE FUNCTION delete_location(OLD_place_id BIGINT) RETURNS BOOLEAN
AS $$
DECLARE
BEGIN
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION add_location(
- place_id INTEGER,
+ place_id BIGINT,
country_code varchar(2),
partition INTEGER,
keywords INTEGER[],
CREATE OR REPLACE FUNCTION update_location(
partition INTEGER,
- place_id INTEGER,
+ place_id BIGINT,
place_country_code varchar(2),
name hstore,
rank_search INTEGER,
$$
LANGUAGE plpgsql;
-CREATE OR REPLACE FUNCTION search_name_add_words(parent_place_id INTEGER, to_add INTEGER[])
+CREATE OR REPLACE FUNCTION search_name_add_words(parent_place_id BIGINT, to_add INTEGER[])
RETURNS BOOLEAN
AS $$
DECLARE
$$
LANGUAGE plpgsql;
-CREATE OR REPLACE FUNCTION update_location_nameonly(partition INTEGER, OLD_place_id INTEGER, name hstore) RETURNS BOOLEAN
+CREATE OR REPLACE FUNCTION update_location_nameonly(partition INTEGER, OLD_place_id BIGINT, name hstore) RETURNS BOOLEAN
AS $$
DECLARE
newkeywords INTEGER[];
originalnumberrange INTEGER;
housenum INTEGER;
linegeo GEOMETRY;
- search_place_id INTEGER;
+ search_place_id BIGINT;
defpostalcode TEXT;
havefirstpoint BOOLEAN;
search_maxrank INTEGER;
address_maxrank INTEGER;
address_street_word_id INTEGER;
- parent_place_id_rank INTEGER;
+ parent_place_id_rank BIGINT;
isin TEXT[];
isin_tokens INT[];
-- Process area matches
location_rank_search := 100;
location_distance := 0;
---RAISE WARNING ' getNearFeatures(%,%,%,%)',NEW.partition, place_centroid, search_maxrank, isin_tokens;
+--RAISE WARNING ' getNearFeatures(%,''%'',%,''%'')',NEW.partition, place_centroid, search_maxrank, isin_tokens;
FOR location IN SELECT * from getNearFeatures(NEW.partition, place_centroid, search_maxrank, isin_tokens) LOOP
--RAISE WARNING ' AREA: %',location;
location_distance := location.distance * 1.5;
END IF;
- IF location.distance < location_distance THEN
+ IF location.distance < location_distance OR NOT location.isguess THEN
-- Add it to the list of search terms
nameaddress_vector := array_merge(nameaddress_vector, location.keywords::integer[]);
INSERT INTO place_addressline VALUES (NEW.place_id, location.place_id, true, NOT address_havelevel[location.rank_address], location.distance, location.rank_address);
address_havelevel[location.rank_address] := true;
+--RAISE WARNING ' Terms: (%) %',location, nameaddress_vector;
+
IF location.rank_address > parent_place_id_rank THEN
NEW.parent_place_id = location.place_id;
parent_place_id_rank = location.rank_address;
CREATE OR REPLACE FUNCTION place_delete() RETURNS TRIGGER
AS $$
DECLARE
- placeid INTEGER;
+ placeid BIGINT;
BEGIN
-- RAISE WARNING 'delete: % % % %',OLD.osm_type,OLD.osm_id,OLD.class,OLD.type;
existing RECORD;
existingplacex RECORD;
existinggeometry GEOMETRY;
- existingplace_id INTEGER;
+ existingplace_id BIGINT;
result BOOLEAN;
partition INTEGER;
BEGIN
select * from placex where osm_type = NEW.osm_type and osm_id = NEW.osm_id and class = NEW.class and type = NEW.type INTO existingplacex;
-- Handle a place changing type by removing the old data
- -- My generated 'place' types are causing havok because they overlap with real tags
+ -- My generated 'place' types are causing havok because they overlap with real keys
-- TODO: move them to their own special purpose key/class to avoid collisions
--- IF existing.osm_type IS NULL AND (NEW.type not in ('postcode','house','houses')) THEN
--- DELETE FROM place where osm_type = NEW.osm_type and osm_id = NEW.osm_id and class = NEW.class and type not in ('postcode','house','houses');
--- END IF;
+ IF existing.osm_type IS NULL AND (NEW.type not in ('postcode','house','houses')) THEN
+ DELETE FROM place where osm_type = NEW.osm_type and osm_id = NEW.osm_id and class = NEW.class and type not in ('postcode','house','houses');
+ END IF;
-- RAISE WARNING 'Existing: %',existing.place_id;
$$
LANGUAGE plpgsql IMMUTABLE;
-CREATE OR REPLACE FUNCTION get_address_postcode(for_place_id INTEGER) RETURNS TEXT
+CREATE OR REPLACE FUNCTION get_address_postcode(for_place_id BIGINT) RETURNS TEXT
AS $$
DECLARE
result TEXT[];
$$
LANGUAGE plpgsql;
-CREATE OR REPLACE FUNCTION get_address_by_language(for_place_id INTEGER, languagepref TEXT[]) RETURNS TEXT
+CREATE OR REPLACE FUNCTION get_address_by_language(for_place_id BIGINT, languagepref TEXT[]) RETURNS TEXT
AS $$
DECLARE
result TEXT[];
DROP TYPE addressline CASCADE;
create type addressline as (
- place_id INTEGER,
+ place_id BIGINT,
osm_type CHAR(1),
osm_id INTEGER,
name HSTORE,
distance FLOAT
);
-CREATE OR REPLACE FUNCTION get_addressdata(in_place_id INTEGER) RETURNS setof addressline
+CREATE OR REPLACE FUNCTION get_addressdata(in_place_id BIGINT) RETURNS setof addressline
AS $$
DECLARE
- for_place_id INTEGER;
+ for_place_id BIGINT;
result TEXT[];
search TEXT[];
found INTEGER;
$$
LANGUAGE plpgsql;
-CREATE OR REPLACE FUNCTION get_place_boundingbox(search_place_id INTEGER) RETURNS place_boundingbox
+CREATE OR REPLACE FUNCTION get_place_boundingbox(search_place_id BIGINT) RETURNS place_boundingbox
AS $$
DECLARE
result place_boundingbox;
LANGUAGE plpgsql;
-- don't do the operation if it would be slow
-CREATE OR REPLACE FUNCTION get_place_boundingbox_quick(search_place_id INTEGER) RETURNS place_boundingbox
+CREATE OR REPLACE FUNCTION get_place_boundingbox_quick(search_place_id BIGINT) RETURNS place_boundingbox
AS $$
DECLARE
result place_boundingbox;
$$
LANGUAGE plpgsql;
-CREATE OR REPLACE FUNCTION update_place(search_place_id INTEGER) RETURNS BOOLEAN
+CREATE OR REPLACE FUNCTION update_place(search_place_id BIGINT) RETURNS BOOLEAN
AS $$
DECLARE
result place_boundingbox;
rangestartnumber INTEGER;
place_centroid GEOMETRY;
partition INTEGER;
- parent_place_id INTEGER;
+ parent_place_id BIGINT;
location RECORD;
address_street_word_id INTEGER;
newpoints INTEGER;
place_centroid GEOMETRY;
partition INTEGER;
- parent_place_id INTEGER;
+ out_parent_place_id BIGINT;
location RECORD;
address_street_word_id INTEGER;
+ out_postcode TEXT;
BEGIN
place_centroid := ST_Centroid(pointgeo);
partition := get_partition(place_centroid, in_countrycode);
- parent_place_id := null;
+ out_parent_place_id := null;
address_street_word_id := get_name_id(make_standard_name(in_street));
IF address_street_word_id IS NOT NULL THEN
FOR location IN SELECT * from getNearestNamedRoadFeature(partition, place_centroid, address_street_word_id) LOOP
- parent_place_id := location.place_id;
+ out_parent_place_id := location.place_id;
END LOOP;
END IF;
- IF parent_place_id IS NULL THEN
+ IF out_parent_place_id IS NULL THEN
FOR location IN SELECT place_id FROM getNearestRoadFeature(partition, place_centroid) LOOP
- parent_place_id := location.place_id;
+ out_parent_place_id := location.place_id;
END LOOP;
END IF;
+ out_postcode := in_postcode;
+ IF out_postcode IS NULL THEN
+ SELECT postcode from placex where place_id = out_parent_place_id INTO out_postcode;
+ END IF;
+ IF out_postcode IS NULL THEN
+ out_postcode := getNearestPostcode(partition, place_centroid);
+ END IF;
+
newpoints := 0;
insert into location_property_aux (place_id, partition, parent_place_id, housenumber, postcode, centroid)
- values (nextval('seq_place'), partition, parent_place_id, in_housenumber, in_postcode, place_centroid);
+ values (nextval('seq_place'), partition, out_parent_place_id, in_housenumber, out_postcode, place_centroid);
newpoints := newpoints + 1;
RETURN newpoints;
+drop type nearplace cascade;
create type nearplace as (
- place_id integer
+ place_id BIGINT
);
+drop type nearfeature cascade;
create type nearfeature as (
- place_id integer,
+ place_id BIGINT,
keywords int[],
rank_address integer,
rank_search integer,
- distance float
+ distance float,
+ isguess boolean
);
CREATE TABLE location_area_country () INHERITS (location_area_large);
CREATE TABLE location_road_-partition- (
partition integer,
- place_id INTEGER,
+ place_id BIGINT,
country_code VARCHAR(2)
);
SELECT AddGeometryColumn('location_road_-partition-', 'geometry', 4326, 'GEOMETRY', 2);
-- start
IF in_partition = -partition- THEN
FOR r IN
- SELECT place_id, keywords, rank_address, rank_search, min(ST_Distance(point, centroid)) as distance FROM (
+ SELECT place_id, keywords, rank_address, rank_search, min(ST_Distance(point, centroid)) as distance, isguess FROM (
SELECT * FROM location_area_large_-partition- WHERE ST_Contains(geometry, point) and rank_search < maxrank
UNION ALL
SELECT * FROM location_area_country WHERE ST_Contains(geometry, point) and rank_search < maxrank
$$
LANGUAGE plpgsql;
-create or replace function deleteLocationArea(in_partition INTEGER, in_place_id integer) RETURNS BOOLEAN AS $$
+create or replace function deleteLocationArea(in_partition INTEGER, in_place_id BIGINT) RETURNS BOOLEAN AS $$
DECLARE
BEGIN
LANGUAGE plpgsql;
create or replace function insertLocationAreaLarge(
- in_partition INTEGER, in_place_id integer, in_country_code VARCHAR(2), in_keywords INTEGER[],
+ in_partition INTEGER, in_place_id BIGINT, in_country_code VARCHAR(2), in_keywords INTEGER[],
in_rank_search INTEGER, in_rank_address INTEGER, in_estimate BOOLEAN,
in_centroid GEOMETRY, in_geometry GEOMETRY) RETURNS BOOLEAN AS $$
DECLARE
IF in_partition = -partition- THEN
FOR r IN
SELECT place_id, name_vector, address_rank, search_rank,
- ST_Distance(centroid, point) as distance
+ ST_Distance(centroid, point) as distance, null as isguess
FROM search_name_-partition-
WHERE name_vector @> ARRAY[isin_token]
AND search_rank < maxrank
UNION ALL
SELECT place_id, name_vector, address_rank, search_rank,
- ST_Distance(centroid, point) as distance
+ ST_Distance(centroid, point) as distance, null as isguess
FROM search_name_country
WHERE name_vector @> ARRAY[isin_token]
AND search_rank < maxrank
IF in_partition = -partition- THEN
FOR r IN
SELECT place_id, name_vector, address_rank, search_rank,
- ST_Distance(centroid, point) as distance
+ ST_Distance(centroid, point) as distance, null as isguess
FROM search_name_-partition-
WHERE name_vector @> ARRAY[isin_token]
AND ST_DWithin(centroid, point, 0.01)
$$
LANGUAGE plpgsql;
+create or replace function getNearestPostcode(in_partition INTEGER, point GEOMETRY)
+ RETURNS TEXT AS $$
+DECLARE
+ out_postcode TEXT;
+BEGIN
+
+-- start
+ IF in_partition = -partition- THEN
+ SELECT postcode
+ FROM location_area_large_-partition- join placex using (place_id)
+ WHERE st_contains(location_area_large_-partition-.geometry, point)
+ AND class = 'place' and type = 'postcode'
+ ORDER BY st_distance(location_area_large_-partition-.centroid, point) ASC limit 1
+ INTO out_postcode;
+ RETURN out_postcode;
+ END IF;
+-- end
+
+ RAISE EXCEPTION 'Unknown partition %', in_partition;
+END
+$$
+LANGUAGE plpgsql;
+
create or replace function insertSearchName(
- in_partition INTEGER, in_place_id integer, in_country_code VARCHAR(2),
+ in_partition INTEGER, in_place_id BIGINT, in_country_code VARCHAR(2),
in_name_vector INTEGER[], in_nameaddress_vector INTEGER[],
in_rank_search INTEGER, in_rank_address INTEGER, in_importance FLOAT,
in_centroid GEOMETRY) RETURNS BOOLEAN AS $$
$$
LANGUAGE plpgsql;
-create or replace function deleteSearchName(in_partition INTEGER, in_place_id integer) RETURNS BOOLEAN AS $$
+create or replace function deleteSearchName(in_partition INTEGER, in_place_id BIGINT) RETURNS BOOLEAN AS $$
DECLARE
BEGIN
LANGUAGE plpgsql;
create or replace function insertLocationRoad(
- in_partition INTEGER, in_place_id integer, in_country_code VARCHAR(2), in_geometry GEOMETRY) RETURNS BOOLEAN AS $$
+ in_partition INTEGER, in_place_id BIGINT, in_country_code VARCHAR(2), in_geometry GEOMETRY) RETURNS BOOLEAN AS $$
DECLARE
BEGIN
$$
LANGUAGE plpgsql;
-create or replace function deleteRoad(in_partition INTEGER, in_place_id integer) RETURNS BOOLEAN AS $$
+create or replace function deleteRoad(in_partition INTEGER, in_place_id BIGINT) RETURNS BOOLEAN AS $$
DECLARE
BEGIN
WHILE search_diameter < 0.1 LOOP
FOR r IN
SELECT place_id, null, null, null,
- ST_Distance(geometry, point) as distance
+ ST_Distance(geometry, point) as distance, null as isguess
FROM location_road_-partition-
WHERE ST_DWithin(geometry, point, search_diameter)
ORDER BY distance ASC limit 1
WHILE search_diameter < 0.01 LOOP
FOR r IN
SELECT place_id, null, null, null,
- ST_Distance(geometry, line) as distance
+ ST_Distance(geometry, line) as distance, null as isguess
FROM location_road_-partition-
WHERE ST_DWithin(line, geometry, search_diameter)
ORDER BY (ST_distance(geometry, p1)+
drop table IF EXISTS location_property CASCADE;
CREATE TABLE location_property (
- place_id INTEGER,
+ place_id BIGINT,
partition integer,
- parent_place_id INTEGER,
+ parent_place_id BIINT,
housenumber TEXT,
postcode TEXT
);
drop table IF EXISTS search_name_blank CASCADE;
CREATE TABLE search_name_blank (
- place_id INTEGER,
+ place_id BIGINT,
search_rank integer,
address_rank integer,
importance FLOAT,
drop table IF EXISTS place_addressline;
CREATE TABLE place_addressline (
- place_id INTEGER,
- address_place_id INTEGER,
+ place_id BIGINT,
+ address_place_id BIGINT,
fromarea boolean,
isaddress boolean,
distance float,
drop table IF EXISTS place_boundingbox CASCADE;
CREATE TABLE place_boundingbox (
- place_id INTEGER,
+ place_id BIGINT,
minlat float,
maxlat float,
minlon float,
drop table placex;
CREATE TABLE placex (
- place_id INTEGER NOT NULL,
+ place_id BIGINT NOT NULL,
partition integer,
osm_type char(1),
osm_id INTEGER,
postcode TEXT,
country_code varchar(2),
extratags HSTORE,
- parent_place_id INTEGER,
- linked_place_id INTEGER,
+ parent_place_id BIGINT,
+ linked_place_id BIGINT,
rank_address INTEGER,
rank_search INTEGER,
importance FLOAT,
drop table IF EXISTS location_area CASCADE;
CREATE TABLE location_area (
partition integer,
- place_id INTEGER,
+ place_id BIGINT,
country_code VARCHAR(2),
keywords INTEGER[],
rank_search INTEGER NOT NULL,
drop table IF EXISTS location_property CASCADE;
CREATE TABLE location_property (
- place_id INTEGER,
+ place_id BIGINT,
partition integer,
- parent_place_id INTEGER,
+ parent_place_id BIGINT,
housenumber TEXT,
postcode TEXT
);
drop table IF EXISTS search_name_blank CASCADE;
CREATE TABLE search_name_blank (
- place_id INTEGER,
+ place_id BIGINT,
search_rank integer,
address_rank integer,
importance FLOAT,
drop table IF EXISTS place_addressline;
CREATE TABLE place_addressline (
- place_id INTEGER,
- address_place_id INTEGER,
+ place_id BIGINT,
+ address_place_id BIGINT,
fromarea boolean,
isaddress boolean,
distance float,
drop table IF EXISTS place_boundingbox CASCADE;
CREATE TABLE place_boundingbox (
- place_id INTEGER,
+ place_id BIGINT,
minlat float,
maxlat float,
minlon float,
CREATE TABLE reverse_cache (
latlonzoomid integer,
country_code varchar(2),
- place_id INTEGER
+ place_id BIGINT
);
GRANT SELECT on reverse_cache to "www-data" ;
GRANT INSERT on reverse_cache to "www-data" ;
drop table placex;
CREATE TABLE placex (
- place_id INTEGER NOT NULL,
+ place_id BIGINT NOT NULL,
partition integer,
osm_type char(1),
osm_id INTEGER,
postcode TEXT,
country_code varchar(2),
extratags HSTORE,
- parent_place_id INTEGER,
- linked_place_id INTEGER,
+ parent_place_id BIGINT,
+ linked_place_id BIGINT,
rank_address INTEGER,
rank_search INTEGER,
importance FLOAT,
2 => STDERR
);
$ahPipes = null;
- $hProcess = proc_open($sCMD, $aDescriptors, $ahPipes);
+ $hProcess = @proc_open($sCMD, $aDescriptors, $ahPipes);
if (!is_resource($hProcess)) fail('unable to start pgsql');
while(strlen($sScript))