kartoza / docker-postgis

Dockerfile for postgis
GNU General Public License v2.0
648 stars 317 forks source link

Error creating extensions when more than one database #406

Closed bobeal closed 1 year ago

bobeal commented 1 year ago

Hi,

I have a setup where I create two databases and load multiple extensions:

  postgres:
    image: kartoza/postgis:15-3.3
    environment:
      - POSTGRES_DBNAME=db1,db2
      - POSTGRES_MULTIPLE_EXTENSIONS=postgis,timescaledb,pgcrypto
      - [other environment variables]
    [other config like ports and volume]

The creation of the extensions goes well for the 1st DB in the list. However, for the second DB, it seems like the parsing of the extensions fails somewhere and the following command is issued instead (which of course fails):

CREATE EXTENSION IF NOT EXISTS postgis timescaledb pgcrypto cascade;

Tried to find the origin of the problem in setup-database.sh and in the new extension_install function in env-data.sh but found nothing obvious (for me, my shell knowledge is quite limited...).

NyakudyaA commented 1 year ago

I will take a look when I have som free time, I will also add this scenario in tests https://github.com/kartoza/docker-postgis/blob/develop/scenario_tests/extensions/docker-compose.yml

bobeal commented 1 year ago

Thanks!