Skip to content

Commit

Permalink
Merge pull request #345 from holland-backup/devel
Browse files Browse the repository at this point in the history
Remove role option that doesn't exist in pg_basebackup
  • Loading branch information
soulen3 authored Nov 15, 2021
2 parents 152dd2e + a3202bc commit 1745ba5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
1 change: 0 additions & 1 deletion config/providers/pg_basebackup.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
format = tar
wal-method = fetch
checkpoint = fast
# role = "" # no default
# additional-options = "" # no default

[pgauth]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ def get_connection(config, pgdb="template1"):
# set connection in autocommit mode
connection.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)

if config["pg-basebackup"]["role"]:
try:
cursor = connection.cursor()
cursor.execute("SET ROLE %s" % config["pg-basebackup"]["role"])
except:
raise PgError("Failed to set role to " + config["pg-basebackup"]["role"])

global VER # pylint: disable=W0603
VER = connection.get_parameter_status("server_version")
LOG.info("Server version %s", VER)
Expand Down Expand Up @@ -197,14 +190,6 @@ def pgauth2args(config):
if value is not None:
args.extend(["--%s" % key, str(value)])

if config["pg-basebackup"]["role"]:
if VER >= "8.4":
args.extend(["--role", config["pg-basebackup"]["role"]])
else:
raise PgError(
"The --role option is available only in Postgres" " versions 8.4 and higher."
)

return args


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
format = option('tar','plain',default='tar')
wal-method = option('none','fetch','stream',default='fetch')
checkpoint = option('none','fast','spread',default='fast')
role = string(default=None)
additional-options = string(default=None)
[pgauth]
Expand Down

0 comments on commit 1745ba5

Please sign in to comment.