Skip to content

Add options to pg_upgrade #125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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