File tree Expand file tree Collapse file tree 6 files changed +84
-48
lines changed Expand file tree Collapse file tree 6 files changed +84
-48
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
- POSTGRES=" gosu postgres postgres"
3
2
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';
7
12
EOSQL
8
13
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
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
- POSTGRES=" gosu postgres postgres"
3
2
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';
7
12
EOSQL
8
13
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
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
- POSTGRES=" gosu postgres postgres"
3
2
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';
7
12
EOSQL
8
13
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
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
- POSTGRES=" gosu postgres postgres"
3
2
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';
7
12
EOSQL
8
13
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
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
- POSTGRES=" gosu postgres postgres"
3
2
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';
7
12
EOSQL
8
13
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
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
- POSTGRES=" gosu postgres postgres"
3
2
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';
7
12
EOSQL
8
13
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
You can’t perform that action at this time.
0 commit comments