-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raster broken #191
Comments
workaround:please check https://hub.docker.com/_/postgres "Initialization scripts" part to understand the initialization logic.
I have created 2 example .. ( simple ; hacker ) simple example ( recommended ) :# create simple extension script
echo "CREATE EXTENSION IF NOT EXISTS postgis_raster;" > 80_create_extension_postgis_raster.sql
# Start Server
docker run --name simpleraster \
-e POSTGRES_PASSWORD=mysecretpassword \
-v $(pwd)/80_create_extension_postgis_raster.sql:/docker-entrypoint-initdb.d/80_create_extension_postgis_raster.sql \
-d postgis/postgis:12-3.0
sleep 13
docker run --rm -it --link simpleraster:postgres \
postgis/postgis:12-3.0 \
sh -c 'PGPASSWORD=mysecretpassword exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres -c "\dx "'
....
# expected result:
List of installed extensions
Name | Version | Schema | Description
------------------------+---------+------------+---------------------------------------------------------------------
fuzzystrmatch | 1.1 | public | determine similarities and distance between strings
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
postgis | 3.0.1 | public | PostGIS geometry, geography, and raster spatial types and functions
postgis_raster | 3.0.1 | public | PostGIS raster types and functions
postgis_tiger_geocoder | 3.0.1 | tiger | PostGIS tiger geocoder and reverse geocoder
postgis_topology | 3.0.1 | topology | PostGIS topology spatial types and functions
(6 rows) hacker example:# create new modified /docker-entrypoint-initdb.d/10_postgis.sh
rm -f initdb-postgis.sh
wget https://raw.githubusercontent.com/postgis/docker-postgis/master/12-3.0/initdb-postgis.sh
cat initdb-postgis.sh \
| sed 's/postgis_tiger_geocoder/postgis_raster/g' \
| sed 's/fuzzystrmatch/hstore/g' \
> 10_postgis.sh
# create ./70_create_extension.sql
cat > ./70_create_extension.sql <<EOL
---- create multiple extensions ---------
CREATE EXTENSION IF NOT EXISTS bloom;
CREATE EXTENSION IF NOT EXISTS btree_gin;
CREATE EXTENSION IF NOT EXISTS btree_gist;
CREATE EXTENSION IF NOT EXISTS cube;
CREATE EXTENSION IF NOT EXISTS intarray;
CREATE EXTENSION IF NOT EXISTS pg_trgm;
CREATE EXTENSION IF NOT EXISTS pgcrypto;
------------------------------------------
EOL
# create 71_create_extension_unaccent.sql
echo "CREATE EXTENSION IF NOT EXISTS unaccent;" > 71_create_extension_unaccent.sql
# Start Server
docker run --name mypostgis \
-e POSTGRES_PASSWORD=mysecretpassword \
-v $(pwd)/10_postgis.sh:/docker-entrypoint-initdb.d/10_postgis.sh \
-v $(pwd)/70_create_extension.sql:/docker-entrypoint-initdb.d/70_create_extension.sql \
-v $(pwd)/71_create_extension_unaccent.sql:/docker-entrypoint-initdb.d/71_create_extension_unaccent.sql \
-d postgis/postgis:12-3.0
sleep 5
# check server logs;
docker logs mypostgis
# Test server
docker run --rm -it --link mypostgis:postgres \
postgis/postgis:12-3.0 \
sh -c 'PGPASSWORD=mysecretpassword exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres -c "\dx "' log :
|
12-3.0 seems to have broken rasters due to changes in 3.0. Is there any chance of including it in the default install until another solution is decided #(187)?
The text was updated successfully, but these errors were encountered: