docker-postgresql-multiple-databases icon indicating copy to clipboard operation
docker-postgresql-multiple-databases copied to clipboard

Non-standard database names don't work as documented

Open mhlmhlmhlmhl opened this issue 2 years ago • 2 comments

This section of the documentation does not work:

Non-standard database names
If you need to use non-standard database names (hyphens, uppercase letters etc), quote them in POSTGRES_MULTIPLE_DATABASES:

    environment:
        - POSTGRES_MULTIPLE_DATABASES: "test-db-1","test-db-2"

On MacOS Ventura 13.0.1, that line is rejected with:

ERROR: yaml.parser.ParserError: while parsing a block mapping

... and IntelliJ says that line has syntax errors.

I ended up removing the quotes in that line and instead changing the script file to add double quotes around every reference to the $database variable.

mhlmhlmhlmhl avatar Apr 01 '23 00:04 mhlmhlmhlmhl

- POSTGRES_MULTIPLE_DATABASES: '"test-db-1","test-db-2"' works fine for me

yallxe avatar Jul 16 '23 11:07 yallxe

Hey I ran into this issue and the solution was simple The script needs to be updated to have double quotes around the $database like so: "$database"

rmiyazaki6499 avatar Oct 31 '23 22:10 rmiyazaki6499