Changed CreateReplicationSlot to return the consistent_point and snapshot_name.
This commit is contained in:
+8
-2
@@ -435,8 +435,14 @@ func (rc *ReplicationConn) StartReplication(slotName string, startLsn uint64, ti
|
||||
}
|
||||
|
||||
// Create the replication slot, using the given name and output plugin.
|
||||
func (rc *ReplicationConn) CreateReplicationSlot(slotName, outputPlugin string) (err error) {
|
||||
_, err = rc.c.Exec(fmt.Sprintf("CREATE_REPLICATION_SLOT %s LOGICAL %s", slotName, outputPlugin))
|
||||
func (rc *ReplicationConn) CreateReplicationSlot(slotName, outputPlugin string) (consistentPoint string, snapshotName string, err error) {
|
||||
var dummy string
|
||||
var rows *Rows
|
||||
rows, err = rc.sendReplicationModeQuery(fmt.Sprintf("CREATE_REPLICATION_SLOT %s LOGICAL %s", slotName, outputPlugin))
|
||||
defer rows.Close()
|
||||
for rows.Next() {
|
||||
rows.Scan(&dummy, &consistentPoint, &snapshotName, &dummy)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user