@@ -501,8 +501,9 @@ def get_auth_method(t):
501
501
502
502
if allow_logical :
503
503
if not pg_version_ge ('10' ):
504
- raise InitNodeException ("Logical replication is only "
505
- "available for Postgres 10 and newer" )
504
+ raise InitNodeException (
505
+ "Logical replication is only available for Postgres 10 "
506
+ "and newer" )
506
507
conf .write (u"wal_level = logical\n " )
507
508
508
509
# disable UNIX sockets if asked to
@@ -1022,11 +1023,7 @@ def catchup(self, dbname=None, username=None):
1022
1023
except Exception as e :
1023
1024
raise_from (CatchUpException ("Failed to catch up" , poll_lsn ), e )
1024
1025
1025
- def publish (self ,
1026
- name ,
1027
- tables = None ,
1028
- dbname = None ,
1029
- username = None ):
1026
+ def publish (self , name , ** kwargs ):
1030
1027
"""
1031
1028
Create publication for logical replication
1032
1029
@@ -1036,25 +1033,26 @@ def publish(self,
1036
1033
dbname: database name where objects or interest are located
1037
1034
username: replication username
1038
1035
"""
1039
- return Publication (name = name , node = self , tables = tables , dbname = dbname ,
1040
- username = username )
1036
+ return Publication (name = name , node = self , ** kwargs )
1041
1037
1042
- def subscribe (self ,
1043
- publication ,
1044
- name ,
1045
- dbname = None ,
1046
- username = None ,
1047
- ** kwargs ):
1038
+ def subscribe (self , publication , name , dbname = None , username = None ,
1039
+ ** params ):
1048
1040
"""
1049
1041
Create subscription for logical replication
1050
1042
1051
1043
Args:
1052
- subname : subscription name
1044
+ name : subscription name
1053
1045
publication: publication object obtained from publish()
1054
-
1046
+ dbname: database name
1047
+ username: replication username
1048
+ params: subscription parameters (see documentation on `CREATE SUBSCRIPTION
1049
+ <https://www.postgresql.org/docs/current/static/sql-createsubscription.html>`_
1050
+ for details)
1055
1051
"""
1052
+ # yapf: disable
1056
1053
return Subscription (name = name , node = self , publication = publication ,
1057
- dbname = dbname , username = username , ** kwargs )
1054
+ dbname = dbname , username = username , ** params )
1055
+ # yapf: enable
1058
1056
1059
1057
def pgbench (self ,
1060
1058
dbname = None ,
0 commit comments