Top Description Methods
org.postgresql.replication

public Interface PGReplicationConnection

Known Direct Implementers
org.postgresql.replication.PGReplicationConnectionImpl
Imports
org.postgresql.PGProperty, org.postgresql.replication.fluent.ChainedCreateReplicationSlotBuilder, .ChainedStreamBuilder, java.sql.SQLException

Api available only if connection was create with required for replication properties: PGProperty#REPLICATION and PGProperty#ASSUME_MIN_SERVER_VERSION. Without it property building replication stream fail with exception.

Method Summary

Modifier and TypeMethod and Description
public ChainedCreateReplicationSlotBuilder

Returns:

not null fluent api for build create replication slot
createReplicationSlot
()

Create replication slot, that can be next use in PGReplicationConnection#replicationStream()

Replication slots provide an automated way to ensure that the master does not remove WAL segments until they have been received by all standbys, and that the master does not remove rows which could cause a recovery conflict even when the standby is disconnected.

public void
dropReplicationSlot(String
not null replication slot name exists in database that should be drop
slotName
)

public ChainedStreamBuilder

Returns:

not null fluent api for build replication stream
replicationStream
()

After start replication stream this connection not available to use for another queries until replication stream will not close.

Method Detail

createReplicationSlotback to summary
public ChainedCreateReplicationSlotBuilder createReplicationSlot()

Create replication slot, that can be next use in PGReplicationConnection#replicationStream()

Replication slots provide an automated way to ensure that the master does not remove WAL segments until they have been received by all standbys, and that the master does not remove rows which could cause a recovery conflict even when the standby is disconnected.

Returns:ChainedCreateReplicationSlotBuilder

not null fluent api for build create replication slot

dropReplicationSlotback to summary
public void dropReplicationSlot(String slotName) throws SQLException
Parameters
slotName:String

not null replication slot name exists in database that should be drop

Exceptions
SQLException:
if the replication slot cannot be dropped.
replicationStreamback to summary
public ChainedStreamBuilder replicationStream()

After start replication stream this connection not available to use for another queries until replication stream will not close.

Returns:ChainedStreamBuilder

not null fluent api for build replication stream