Skip to content

Commit 37a0964

Browse files
committed
Merge pull request #9 from appropriate/initdb-updates
Update initdb-postgis.sh script to account for upstream changes
2 parents f1a9e0b + bf8bfec commit 37a0964

File tree

13 files changed

+91
-55
lines changed

13 files changed

+91
-55
lines changed

9.0-2.1/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM postgres:9.0
2-
MAINTAINER Mike Dillon <mike@embody.org>
2+
MAINTAINER Mike Dillon <mike@appropriate.io>
33

44
ENV POSTGIS_MAJOR 2.1
55
ENV POSTGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1

9.0-2.1/initdb-postgis.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
#!/bin/sh
2-
POSTGRES="gosu postgres postgres"
32

4-
$POSTGRES --single -E <<EOSQL
5-
CREATE DATABASE template_postgis
6-
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis'
3+
set -e
4+
5+
# Perform all actions as user 'postgres'
6+
export PGUSER=postgres
7+
8+
# Create the 'template_postgis' template db
9+
psql <<EOSQL
10+
CREATE DATABASE template_postgis;
11+
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
712
EOSQL
813

9-
POSTGIS_CONFIG=/usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
10-
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/postgis.sql
11-
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/topology.sql
12-
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/spatial_ref_sys.sql
14+
# Populate 'template_postgis'
15+
cd /usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
16+
psql --dbname template_postgis < postgis.sql
17+
psql --dbname template_postgis < topology.sql
18+
psql --dbname template_postgis < spatial_ref_sys.sql

9.1-2.1/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM postgres:9.1
2-
MAINTAINER Mike Dillon <mike@embody.org>
2+
MAINTAINER Mike Dillon <mike@appropriate.io>
33

44
ENV POSTGIS_MAJOR 2.1
55
ENV POSTGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1

9.1-2.1/initdb-postgis.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
#!/bin/sh
2-
POSTGRES="gosu postgres postgres"
32

4-
$POSTGRES --single -E <<EOSQL
5-
CREATE DATABASE template_postgis
6-
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis'
3+
set -e
4+
5+
# Perform all actions as user 'postgres'
6+
export PGUSER=postgres
7+
8+
# Create the 'template_postgis' template db
9+
psql <<EOSQL
10+
CREATE DATABASE template_postgis;
11+
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
712
EOSQL
813

9-
POSTGIS_CONFIG=/usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
10-
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/postgis.sql
11-
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/topology.sql
12-
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/spatial_ref_sys.sql
14+
# Populate 'template_postgis'
15+
cd /usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
16+
psql --dbname template_postgis < postgis.sql
17+
psql --dbname template_postgis < topology.sql
18+
psql --dbname template_postgis < spatial_ref_sys.sql

9.2-2.1/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM postgres:9.2
2-
MAINTAINER Mike Dillon <mike@embody.org>
2+
MAINTAINER Mike Dillon <mike@appropriate.io>
33

44
ENV POSTGIS_MAJOR 2.1
55
ENV POSTGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1

9.2-2.1/initdb-postgis.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
#!/bin/sh
2-
POSTGRES="gosu postgres postgres"
32

4-
$POSTGRES --single -E <<EOSQL
5-
CREATE DATABASE template_postgis
6-
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis'
3+
set -e
4+
5+
# Perform all actions as user 'postgres'
6+
export PGUSER=postgres
7+
8+
# Create the 'template_postgis' template db
9+
psql <<EOSQL
10+
CREATE DATABASE template_postgis;
11+
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
712
EOSQL
813

9-
POSTGIS_CONFIG=/usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
10-
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/postgis.sql
11-
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/topology.sql
12-
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/spatial_ref_sys.sql
14+
# Populate 'template_postgis'
15+
cd /usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
16+
psql --dbname template_postgis < postgis.sql
17+
psql --dbname template_postgis < topology.sql
18+
psql --dbname template_postgis < spatial_ref_sys.sql

9.3-2.1/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM postgres:9.3
2-
MAINTAINER Mike Dillon <mike@embody.org>
2+
MAINTAINER Mike Dillon <mike@appropriate.io>
33

44
ENV POSTGIS_MAJOR 2.1
55
ENV POSTGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1

9.3-2.1/initdb-postgis.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
#!/bin/sh
2-
POSTGRES="gosu postgres postgres"
32

4-
$POSTGRES --single -E <<EOSQL
5-
CREATE DATABASE template_postgis
6-
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis'
3+
set -e
4+
5+
# Perform all actions as user 'postgres'
6+
export PGUSER=postgres
7+
8+
# Create the 'template_postgis' template db
9+
psql <<EOSQL
10+
CREATE DATABASE template_postgis;
11+
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
712
EOSQL
813

9-
POSTGIS_CONFIG=/usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
10-
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/postgis.sql
11-
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/topology.sql
12-
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/spatial_ref_sys.sql
14+
# Populate 'template_postgis'
15+
cd /usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
16+
psql --dbname template_postgis < postgis.sql
17+
psql --dbname template_postgis < topology.sql
18+
psql --dbname template_postgis < spatial_ref_sys.sql

9.4-2.1/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM postgres:9.4
2-
MAINTAINER Mike Dillon <mike@embody.org>
2+
MAINTAINER Mike Dillon <mike@appropriate.io>
33

44
ENV POSTGIS_MAJOR 2.1
55
ENV POSTGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1

9.4-2.1/initdb-postgis.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
#!/bin/sh
2-
POSTGRES="gosu postgres postgres"
32

4-
$POSTGRES --single -E <<EOSQL
5-
CREATE DATABASE template_postgis
6-
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis'
3+
set -e
4+
5+
# Perform all actions as user 'postgres'
6+
export PGUSER=postgres
7+
8+
# Create the 'template_postgis' template db
9+
psql <<EOSQL
10+
CREATE DATABASE template_postgis;
11+
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
712
EOSQL
813

9-
POSTGIS_CONFIG=/usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
10-
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/postgis.sql
11-
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/topology.sql
12-
$POSTGRES --single template_postgis -j < $POSTGIS_CONFIG/spatial_ref_sys.sql
14+
# Populate 'template_postgis'
15+
cd /usr/share/postgresql/$PG_MAJOR/contrib/postgis-$POSTGIS_MAJOR
16+
psql --dbname template_postgis < postgis.sql
17+
psql --dbname template_postgis < topology.sql
18+
psql --dbname template_postgis < spatial_ref_sys.sql

0 commit comments

Comments
 (0)