Skip to content

Commit

Permalink
Remove need for shared library PostgreSQL functions
Browse files Browse the repository at this point in the history
This is no longer needed as of PR
openstreetmap#2383
  • Loading branch information
jalessio committed Oct 20, 2019
1 parent 007a38b commit 07dc7b5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
23 changes: 1 addition & 22 deletions docker/postgres/Dockerfile
@@ -1,25 +1,4 @@
FROM postgres:11

RUN apt-get update && \
apt-get install -y \
build-essential \
curl \
postgresql-server-dev-all && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Setup app location
RUN mkdir -p /app
WORKDIR /app

# Add custom database functions
ADD db/functions/ /app/db/functions/

# Get quad_tile.h header file from quad_tile repository and
# use it to make libpgosm.so for OSM-specific Postgres functions.
RUN cd db/functions && \
curl -# -O https://raw.githubusercontent.com/openstreetmap/quad_tile/9fcba83fcbca8a206fa518da5a52f840dc2ecb09/ext/quad_tile/quad_tile.h && \
make -e QTDIR=/app/db/functions libpgosm.so

# Add db init script to install OSM-specific Postgres functions
# Add db init script to install OSM-specific Postgres functions/extensions.
ADD docker/postgres/openstreetmap-postgres-init.sh /docker-entrypoint-initdb.d/
3 changes: 0 additions & 3 deletions docker/postgres/openstreetmap-postgres-init.sh
Expand Up @@ -2,6 +2,3 @@
set -e

psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -c "CREATE EXTENSION btree_gist" openstreetmap
psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -c "CREATE FUNCTION maptile_for_point(int8, int8, int4) RETURNS int4 AS '/app/db/functions/libpgosm', 'maptile_for_point' LANGUAGE C STRICT" openstreetmap
psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -c "CREATE FUNCTION tile_for_point(int4, int4) RETURNS int8 AS '/app/db/functions/libpgosm', 'tile_for_point' LANGUAGE C STRICT" openstreetmap
psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -c "CREATE FUNCTION xid_to_int4(xid) RETURNS int4 AS '/app/db/functions/libpgosm', 'xid_to_int4' LANGUAGE C STRICT" openstreetmap

0 comments on commit 07dc7b5

Please sign in to comment.