postgis / docker-postgis

Docker image for PostGIS
https://hub.docker.com/r/postgis/postgis/
MIT License
1.35k stars 462 forks source link

"fix search_path race" v2 - with make update #292

Closed ImreSamu closed 2 years ago

ImreSamu commented 2 years ago

the https://github.com/postgis/docker-postgis/pull/290 only has been fixed the template files; and this PR with make update - regenerating everywhere.

( cc: @strk ; @phillipross )

Locally tested:

the new postgis/postgis:13-3.2-alpine version:

psql (13.6)
Type "help" for help.

postgres=# show search_path;
           search_path            
----------------------------------
 "$user", public, topology, tiger
(1 row)

the new postgis/postgis:13-3.2 version:

psql (13.6 (Debian 13.6-1.pgdg110+1))
Type "help" for help.

postgres=# show search_path;
           search_path            
----------------------------------
 "$user", public, topology, tiger
(1 row)

and the server logs look ok. Alpine log

waiting for server to start....2022-04-08 09:41:49.648 UTC [36] LOG:  starting PostgreSQL 13.6 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20211027) 10.3.1 20211027, 64-bit
2022-04-08 09:41:49.650 UTC [36] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-04-08 09:41:49.654 UTC [37] LOG:  database system was shut down at 2022-04-08 09:41:49 UTC
2022-04-08 09:41:49.657 UTC [36] LOG:  database system is ready to accept connections
 done
server started

/usr/local/bin/docker-entrypoint.sh: sourcing /docker-entrypoint-initdb.d/10_postgis.sh
CREATE DATABASE
Loading PostGIS extensions into template_postgis
CREATE EXTENSION
CREATE EXTENSION
CREATE EXTENSION
CREATE EXTENSION
Loading PostGIS extensions into postgres
CREATE EXTENSION
CREATE EXTENSION
CREATE EXTENSION
CREATE EXTENSION

waiting for server to shut down....2022-04-08 09:41:53.163 UTC [36] LOG:  received fast shutdown request

debian log - has an extra You are now connected to database "postgres" as user "postgres".

waiting for server to start....2022-04-08 10:47:55.803 UTC [49] LOG:  starting PostgreSQL 13.6 (Debian 13.6-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2022-04-08 10:47:55.804 UTC [49] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-04-08 10:47:55.810 UTC [50] LOG:  database system was shut down at 2022-04-08 10:47:55 UTC
2022-04-08 10:47:55.815 UTC [49] LOG:  database system is ready to accept connections
 done
server started

/usr/local/bin/docker-entrypoint.sh: sourcing /docker-entrypoint-initdb.d/10_postgis.sh
CREATE DATABASE
Loading PostGIS extensions into template_postgis
CREATE EXTENSION
CREATE EXTENSION
You are now connected to database "template_postgis" as user "postgres".
CREATE EXTENSION
CREATE EXTENSION
Loading PostGIS extensions into postgres
CREATE EXTENSION
CREATE EXTENSION
You are now connected to database "postgres" as user "postgres".
CREATE EXTENSION
CREATE EXTENSION

waiting for server to shut down...2022-04-08 10:47:58.581 UTC [49] LOG:  received fast shutdown request
ImreSamu commented 2 years ago
phillipross commented 2 years ago

The init file is not generated from templates? I took a quick look and don't see it being generated, but I could swear it was generated in the past 🤔

ImreSamu commented 2 years ago

I just wonder if there's a way to avoid all this duplication...

Now we have

With the jq templating we can adapt some complex templating logic like this example:

        --with-libxslt \
        --with-icu \
{{ if .major >= 11 then ( -}}
        --with-llvm \
{{ ) else "" end -}}
{{ if .major >= 14 then ( -}}
        --with-lz4 \
{{ ) else "" end -}}

But some quick improvements could be made now ; like renaming the other template files ;

ImreSamu commented 2 years ago

I have updated the *-master images

the 14-master version:

 PostgreSQL 14.2 (Debian 14.2-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
 POSTGIS="3.3.0dev 3.2.0-809-gc9885d527" [EXTENSION] PGSQL="140" GEOS="3.11.0dev-CAPI-1.16.0" PROJ="9.1.0" LIBXML="2.9.10" LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal)"

CI/CD tests OK: :heavy_check_mark:

Ready to merge. ( cc @phillipross )