🌐 AI搜索 & 代理 主页
Skip to content
Merged
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
Add options to pg_upgrade
  • Loading branch information
fabriziomello committed May 24, 2024
commit 2dd82d84d54afc4e2520e0ff2fc52a61fd72830c
6 changes: 5 additions & 1 deletion testgres/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1639,7 +1639,7 @@ def set_auto_conf(self, options, config='postgresql.auto.conf', rm_options={}):

self.os_ops.write(path, auto_conf, truncate=True)

def upgrade_from(self, old_node):
def upgrade_from(self, old_node, options=None):
"""
Upgrade this node from an old node using pg_upgrade.
Expand All @@ -1652,6 +1652,9 @@ def upgrade_from(self, old_node):
if not os.path.exists(self.data_dir):
self.init()

if not options:
options = []

pg_upgrade_binary = self._get_bin_path("pg_upgrade")

if not os.path.exists(pg_upgrade_binary):
Expand All @@ -1666,6 +1669,7 @@ def upgrade_from(self, old_node):
"--old-port", str(old_node.port),
"--new-port", str(self.port),
]
upgrade_command += options

return self.os_ops.exec_command(upgrade_command)

Expand Down