Skip to content
Open
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
2 changes: 1 addition & 1 deletion omnibus/config/software/oc_id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# and makeds more sense than adding the thing that is stopping
# it from building on s390 (libxml2).
dependency "nokogiri"
dependency "postgresql13" # for libpq
dependency "postgresql14" # for libpq
dependency "ruby"

relative_path "oc-id"
Expand Down
2 changes: 1 addition & 1 deletion omnibus/config/software/partybus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
license :project_license

dependency "ruby"
dependency "postgresql13"
dependency "postgresql14"

build do
env = with_standard_compiler_flags(with_embedded_path)
Expand Down
2 changes: 1 addition & 1 deletion omnibus/config/software/perl_pg_driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

dependency "perl"
dependency "cpanminus"
dependency "postgresql13"
dependency "postgresql14"

source url: "http://search.cpan.org/CPAN/authors/id/T/TU/TURNSTEP/DBD-Pg-#{version}.tar.gz",
md5: "547de1382a47d66872912fe64282ff55"
Expand Down
64 changes: 64 additions & 0 deletions omnibus/config/software/postgresql14.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#
# Copyright:: Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name "postgresql14"

default_version "14.20"

license "PostgreSQL"
license_file "COPYRIGHT"
skip_transitive_dependency_licensing true

dependency "zlib"
dependency "openssl"
dependency "libedit"
dependency "ncurses"
dependency "libossp-uuid"
dependency "config_guess"

# version_list: url=https://ftp.postgresql.org/pub/source/v#{version}/ filter=*.tar.bz2

version("14.20") { source sha256: "7527f10f1640761bc280ad97d105d286d0cf72e54d36d78cf68e5e5f752b646b" }

source url: "https://ftp.postgresql.org/pub/source/v#{version}/postgresql-#{version}.tar.bz2"

relative_path "postgresql-#{version}"

build do
env = with_standard_compiler_flags(with_embedded_path)
short_version = version.gsub(/^([0-9]+).[0-9]+$/, '\1')

update_config_guess(target: "config")

command "./configure" \
" --prefix=#{install_dir}/embedded/postgresql/#{short_version}" \
" --with-libedit-preferred" \
" --with-openssl" \
" --with-ossp-uuid" \
" --with-includes=#{install_dir}/embedded/include" \
" --with-libraries=#{install_dir}/embedded/lib", env: env

make "world -j #{workers}", env: env
make "install-world -j #{workers}", env: env

block do
Dir.glob("#{install_dir}/embedded/postgresql/#{short_version}/bin/*").sort.each do |bin|
link bin, "#{install_dir}/embedded/bin/#{File.basename(bin)}"
end

delete "#{install_dir}/embedded/postgresql/#{short_version}/share/doc"
end
end
2 changes: 1 addition & 1 deletion omnibus/config/software/private-chef-ctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
license :project_license
skip_transitive_dependency_licensing true

dependency "postgresql13" # for libpq
dependency "postgresql14" # for libpq
dependency "omnibus-ctl"

build do
Expand Down
3 changes: 2 additions & 1 deletion omnibus/config/software/server-complete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

# the backend
dependency "postgresql96-bin" # for upgrading 9.6 -> 13
dependency "postgresql13"
dependency "postgresql13" # for upgrading 13 -> 14
dependency "postgresql14"
dependency "valkey" # dynamic routing controls
dependency "haproxy"
dependency "opensearch" # used by search
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@
###
# For now, we're hardcoding the version directory suffix here.
# Since postgresql 10, only use major version numbers.
default['private_chef']['postgresql']['version'] = '13'
default['private_chef']['postgresql']['version'] = '14'
# In the future, we're probably going to want to do something more elegant so we
# don't accidentally overwrite this directory if we upgrade PG to 9.3: keeping these
# directories straight is important because in the distant future (the year 2000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class PostgresqlPreflightValidator < PreflightValidator
# we ship. When we bumped the version we ship to 9.6, we haven't yet
# introduced any changes that _require_ 9.6. So, these constants reflect the
# actually required PG version.
REQUIRED_VERSION = PgVersion.new('9.6')
REQUIRED_VERSION = PgVersion.new('9.6')

# supported PG version
SUPPORTED_VERSION = PgVersion.new('13')
SUPPORTED_VERSION = PgVersion.new('14')

def run!
warn_about_removed_attribute('checkpoint_segments')
Expand Down Expand Up @@ -190,7 +190,7 @@ def backend_verify_postgres_version(connection)
v = PgVersion.new /^([0-9\.]+)/.match(r.first['server_version']).to_a.first

# Note that we're looking for the same major, and using our minor as the minimum version
# This provides compatibility with external databases that use < 13 before we make use
# This provides compatibility with external databases that use < 14 before we make use
# of any features available in > 9.6.

if v.major == REQUIRED_VERSION || v.major == SUPPORTED_VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ class ConnectionBad < RuntimeError; end
end
end

context 'when external version is > 13.x' do
let(:version) { '14.0' }
context 'when external version is > 14.x' do
let(:version) { '15.0' }

it 'fails with a CSPG014 error' do
expect(postgres_validator).to receive(:fail_with).with(error_message)
Expand Down
Loading