Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions ci/release_notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Improvements

- When custom databases are created, the manifest can be used to
specify any PG extensions that need to be loaded via the `extensions`
array attribute on the database.
Example:

```
properties:
pgpool:
databases:
- name: animals
extensions:
- citext
- pgcrypto
```
2 changes: 2 additions & 0 deletions jobs/postgres/spec
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,5 @@ properties:
users:
- porcupine
- hedgehog
extensions: # optional aray of extensions to enable on this database
- citext
10 changes: 8 additions & 2 deletions jobs/postgres/templates/bin/ctl
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,18 @@ EOF
echo >>$LOG_DIR/$JOB_NAME.log "[postgres] setting up database <%= database['name'] %>"
set -x

createdb -U vcap -p <%= port %> -O vcap <%= database['name'] %>

createdb -U vcap -p <%= port %> -O vcap <%= database['name'] %>
<% database['users'].each do |user| %>
psql -p <%= port %> -U vcap postgres -c "GRANT ALL PRIVILEGES ON DATABASE \"<%= database['name'] %>\" TO \"<%= user %>\""
<% end %>

<% if database["extensions"]
database["extensions"].each do |ext| %>
echo "Trying to install <%= ext %>..."
psql -p <%= port %> -U vcap "<%= database['name'] %>" -c "CREATE EXTENSION IF NOT EXISTS <%= ext %>"
<% end
end %>

set +x
echo

Expand Down
4 changes: 2 additions & 2 deletions packages/postgres/packaging
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ VERSION=9.5.1
tar -xjf postgres/postgresql-${VERSION}.tar.bz2
cd postgresql-${VERSION}/
./configure --prefix ${BOSH_INSTALL_TARGET}
make
make install
make world
make install-world
3 changes: 3 additions & 0 deletions templates/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:
users:
- porcupine
- hedgehog
extensions:
- citext
- pgcypto
users:
- username: porcupine
password: quill
Expand Down