#
# Use packages from PostgreSQL Global Development Group
#
apt_repository 'pgdg' do
  uri 'http://apt.postgresql.org/pub/repos/apt/'
  distribution "#{node['lsb']['codename']}-pgdg"
  # 9.4 component is needed to install related libpq5 dependencies
  # See https://wiki.postgresql.org/wiki/Apt/FAQ#I_want_to_try_the_beta_version_of_the_next_PostgreSQL_release
  components ['main', '9.4']
  key 'http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc'

  action :add
end

#
# Use packages from PostgreSQL Global Development Group
#
apt_repository 'pgdg' do
  uri 'http://apt.postgresql.org/pub/repos/apt/'
  distribution "#{node['lsb']['codename']}-pgdg"
  # For beta releases, the corresponding 9.x component is needed to install related libpq5 dependencies
  # See https://wiki.postgresql.org/wiki/Apt/FAQ#I_want_to_try_the_beta_version_of_the_next_PostgreSQL_release
  components ['main', '9.5']
  key 'http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc'

  action :add
end

Make PostgreSQL 9.5 Beta apt packages available
Make PostgreSQL 9.5 Beta apt packages available

This change is a little helper for users interested to install 9.5 on
the build fly. The pre-installation of 9.5 on Travis machine/container
images will only come after general availability (which is currently
planned for end 2015).

Note: '9.4' apt component is no longer necessary (final releases are in
'main' component)
