Skip to content

Commit e534056

Browse files
committed
Do not try to create database 'template1'
1 parent 3884130 commit e534056

6 files changed

+6
-6
lines changed

10/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ docker_process_sql() {
188188
# create initial database
189189
# uses environment variables for input: POSTGRES_DB
190190
docker_setup_db() {
191-
if [ "$POSTGRES_DB" != 'postgres' ]; then
191+
if [ "$POSTGRES_DB" != 'postgres' ] || [ "$POSTGRES_DB" != 'template1' ]; then
192192
POSTGRES_DB= docker_process_sql --dbname postgres --set db="$POSTGRES_DB" <<-'EOSQL'
193193
CREATE DATABASE :"db" ;
194194
EOSQL

11/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ docker_process_sql() {
188188
# create initial database
189189
# uses environment variables for input: POSTGRES_DB
190190
docker_setup_db() {
191-
if [ "$POSTGRES_DB" != 'postgres' ]; then
191+
if [ "$POSTGRES_DB" != 'postgres' ] || [ "$POSTGRES_DB" != 'template1' ]; then
192192
POSTGRES_DB= docker_process_sql --dbname postgres --set db="$POSTGRES_DB" <<-'EOSQL'
193193
CREATE DATABASE :"db" ;
194194
EOSQL

12/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ docker_process_sql() {
188188
# create initial database
189189
# uses environment variables for input: POSTGRES_DB
190190
docker_setup_db() {
191-
if [ "$POSTGRES_DB" != 'postgres' ]; then
191+
if [ "$POSTGRES_DB" != 'postgres' ] || [ "$POSTGRES_DB" != 'template1' ]; then
192192
POSTGRES_DB= docker_process_sql --dbname postgres --set db="$POSTGRES_DB" <<-'EOSQL'
193193
CREATE DATABASE :"db" ;
194194
EOSQL

13/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ docker_process_sql() {
188188
# create initial database
189189
# uses environment variables for input: POSTGRES_DB
190190
docker_setup_db() {
191-
if [ "$POSTGRES_DB" != 'postgres' ]; then
191+
if [ "$POSTGRES_DB" != 'postgres' ] || [ "$POSTGRES_DB" != 'template1' ]; then
192192
POSTGRES_DB= docker_process_sql --dbname postgres --set db="$POSTGRES_DB" <<-'EOSQL'
193193
CREATE DATABASE :"db" ;
194194
EOSQL

9.5/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ docker_process_sql() {
188188
# create initial database
189189
# uses environment variables for input: POSTGRES_DB
190190
docker_setup_db() {
191-
if [ "$POSTGRES_DB" != 'postgres' ]; then
191+
if [ "$POSTGRES_DB" != 'postgres' ] || [ "$POSTGRES_DB" != 'template1' ]; then
192192
POSTGRES_DB= docker_process_sql --dbname postgres --set db="$POSTGRES_DB" <<-'EOSQL'
193193
CREATE DATABASE :"db" ;
194194
EOSQL

9.6/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ docker_process_sql() {
188188
# create initial database
189189
# uses environment variables for input: POSTGRES_DB
190190
docker_setup_db() {
191-
if [ "$POSTGRES_DB" != 'postgres' ]; then
191+
if [ "$POSTGRES_DB" != 'postgres' ] || [ "$POSTGRES_DB" != 'template1' ]; then
192192
POSTGRES_DB= docker_process_sql --dbname postgres --set db="$POSTGRES_DB" <<-'EOSQL'
193193
CREATE DATABASE :"db" ;
194194
EOSQL

0 commit comments

Comments
 (0)