Change postgresql version from 9.6 to 11

pull/82/head
admire 2019-06-05 08:59:15 +02:00
rodzic 58704d0d41
commit 601105f3dc
3 zmienionych plików z 29 dodań i 3 usunięć

Wyświetl plik

@ -9,7 +9,7 @@ volumes:
services:
db:
# About the postgresql version, it should match in the dockerfile of docker-imposm3
image: kartoza/postgis:9.6-2.4
image: kartoza/postgis:11.0-2.5
hostname: db
container_name: dockerosm_db
environment:

Wyświetl plik

@ -1,9 +1,12 @@
FROM golang:1.10
MAINTAINER Etienne Trimaille <etienne.trimaille@gmail.com>
RUN apt-get update
RUN wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add -
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
RUN apt update && apt install -y python3-pip \
libprotobuf-dev libleveldb-dev libgeos-dev \
libpq-dev python3-dev postgresql-client-9.6 python-setuptools \
libpq-dev python3-dev postgresql-client-11 python-setuptools \
gdal-bin \
--no-install-recommends

Wyświetl plik

@ -11,9 +11,32 @@ BEGIN
EXECUTE 'DELETE FROM ' || quote_ident(osm_table.table_name) || ' WHERE osm_id IN (
SELECT DISTINCT osm_id
FROM ' || quote_ident(osm_table.table_name) || '
LEFT JOIN clip ON ST_Intersects(geometry, geom))
LEFT JOIN clip ON ST_Intersects(geometry, geom) where clip.ogc_fid is NULL)
;';
END LOOP;
END;
$BODY$
LANGUAGE plpgsql;
-- Function to validate geometry of all tables. To run it after creating the function sinmply run Select validate_geom();
CREATE OR REPLACE FUNCTION validate_geom() RETURNS void AS
$BODY$
DECLARE osm_tables CURSOR FOR
SELECT table_name
FROM information_schema.tables
WHERE table_schema='public'
AND table_type='BASE TABLE'
AND table_name LIKE 'osm_%';
BEGIN
FOR osm_table IN osm_tables LOOP
EXECUTE 'UPDATE ' || quote_ident(osm_table.table_name) || ' SET
geometry = ST_MakeValid(geometry) where ST_isValidreason(geometry) = ''F'' ;';
END LOOP;
END;
$BODY$
LANGUAGE plpgsql;