We used to hardcode 16 as the version, mostly while generating paths. With the PG17 support, those paths changed to contain 17 instead of 16. Data plane does not know the installed PostgreSQL version, so it needs that information from control plane. With this commit we are updating data plane scripts to accept version parameter from control plane.
16 lines
406 B
Ruby
Executable File
16 lines
406 B
Ruby
Executable File
#!/bin/env ruby
|
|
# frozen_string_literal: true
|
|
|
|
require_relative "../../common/lib/util"
|
|
|
|
if ARGV.count != 1
|
|
fail "Wrong number of arguments. Expected 1, Given #{ARGV.count}"
|
|
end
|
|
|
|
v = ARGV[0]
|
|
|
|
# We don't change the user to postgres here. Instead we run the below
|
|
# command as root, because the cluster is running from systemd, and can
|
|
# only be restarted as root.
|
|
r "sudo pg_ctlcluster #{v} main restart"
|