File tree Expand file tree Collapse file tree 5 files changed +31
-4
lines changed
Expand file tree Collapse file tree 5 files changed +31
-4
lines changed Original file line number Diff line number Diff line change 1+ # Improvements
2+
3+ - When custom databases are created, the manifest can be used to
4+ specify any PG extensions that need to be loaded via the ` extensions `
5+ array attribute on the database.
6+ Example:
7+
8+ ```
9+ properties:
10+ pgpool:
11+ databases:
12+ - name: animals
13+ extensions:
14+ - citext
15+ - pgcrypto
16+ ```
Original file line number Diff line number Diff line change @@ -100,3 +100,5 @@ properties:
100100 users:
101101 - porcupine
102102 - hedgehog
103+ extensions: # optional aray of extensions to enable on this database
104+ - citext
Original file line number Diff line number Diff line change @@ -124,12 +124,18 @@ EOF
124124 echo >> $LOG_DIR /$JOB_NAME .log " [postgres] setting up database <%= database['name'] %>"
125125 set -x
126126
127- createdb -U vcap -p < %= port %> -O vcap < %= database[' name' ] %>
128-
127+ createdb -U vcap -p < %= port %> -O vcap < %= database[' name' ] %>
129128 < % database[' users' ].each do | user| %>
130129 psql -p < %= port %> -U vcap postgres -c " GRANT ALL PRIVILEGES ON DATABASE \" <%= database['name'] %>\" TO \" <%= user %>\" "
131130 < % end %>
132131
132+ < % if database[" extensions" ]
133+ database[" extensions" ].each do | ext| %>
134+ echo " Trying to install <%= ext %>..."
135+ psql -p < %= port %> -U vcap " <%= database['name'] %>" -c " CREATE EXTENSION IF NOT EXISTS <%= ext %>"
136+ < % end
137+ end %>
138+
133139 set +x
134140 echo
135141
Original file line number Diff line number Diff line change @@ -13,5 +13,5 @@ VERSION=9.5.1
1313tar -xjf postgres/postgresql-${VERSION}.tar.bz2
1414cd postgresql-${VERSION}/
1515./configure --prefix ${BOSH_INSTALL_TARGET}
16- make
17- make install
16+ make world
17+ make install-world
Original file line number Diff line number Diff line change 3838 users :
3939 - porcupine
4040 - hedgehog
41+ extensions :
42+ - citext
43+ - pgcypto
4144 users :
4245 - username : porcupine
4346 password : quill
You can’t perform that action at this time.
0 commit comments