Class PgOutputReplicationOptions
- Namespace
- Npgsql.Replication.PgOutput
- Assembly
- Npgsql.dll
Options to be passed to the pgoutput plugin
public class PgOutputReplicationOptions : IEquatable<PgOutputReplicationOptions>
- Inheritance
-
PgOutputReplicationOptions
- Implements
- Inherited Members
Constructors
PgOutputReplicationOptions(IEnumerable<string>, PgOutputProtocolVersion, bool?, PgOutputStreamingMode?, bool?, bool?)
Creates a new instance of PgOutputReplicationOptions.
public PgOutputReplicationOptions(IEnumerable<string> publicationNames, PgOutputProtocolVersion protocolVersion, bool? binary = null, PgOutputStreamingMode? streamingMode = null, bool? messages = null, bool? twoPhase = null)
Parameters
publicationNamesIEnumerable<string>The publication names to include into the stream
protocolVersionPgOutputProtocolVersionThe version of the logical streaming replication protocol
binarybool?Send values in binary representation
streamingModePgOutputStreamingMode?Enable streaming of in-progress transactions
messagesbool?Write logical decoding messages into the replication stream
twoPhasebool?Enable streaming of prepared transactions
PgOutputReplicationOptions(IEnumerable<string>, ulong, bool?, bool?, bool?, bool?)
Creates a new instance of PgOutputReplicationOptions.
[Obsolete("Please switch to the overloads that take PgOutputProtocolVersion and PgOutputStreamingMode values instead.")]
public PgOutputReplicationOptions(IEnumerable<string> publicationNames, ulong protocolVersion, bool? binary = null, bool? streaming = null, bool? messages = null, bool? twoPhase = null)
Parameters
publicationNamesIEnumerable<string>The publication names to include into the stream
protocolVersionulongThe version of the logical streaming replication protocol. Passing in unsupported protocol version numbers may lead to runtime errors.
binarybool?Send values in binary representation
streamingbool?Enable streaming of in-progress transactions. Setting this to true sets StreamingMode to On.
messagesbool?Write logical decoding messages into the replication stream
twoPhasebool?Enable streaming of prepared transactions
PgOutputReplicationOptions(string, PgOutputProtocolVersion, bool?, PgOutputStreamingMode?, bool?, bool?)
Creates a new instance of PgOutputReplicationOptions.
public PgOutputReplicationOptions(string publicationName, PgOutputProtocolVersion protocolVersion, bool? binary = null, PgOutputStreamingMode? streamingMode = null, bool? messages = null, bool? twoPhase = null)
Parameters
publicationNamestringThe publication names to include into the stream
protocolVersionPgOutputProtocolVersionThe version of the logical streaming replication protocol
binarybool?Send values in binary representation
streamingModePgOutputStreamingMode?Enable streaming of in-progress transactions
messagesbool?Write logical decoding messages into the replication stream
twoPhasebool?Enable streaming of prepared transactions
PgOutputReplicationOptions(string, ulong, bool?, bool?, bool?, bool?)
Creates a new instance of PgOutputReplicationOptions.
[Obsolete("Please switch to the overloads that take PgOutputProtocolVersion and PgOutputStreamingMode values instead.")]
public PgOutputReplicationOptions(string publicationName, ulong protocolVersion, bool? binary = null, bool? streaming = null, bool? messages = null, bool? twoPhase = null)
Parameters
publicationNamestringThe publication names to include into the stream
protocolVersionulongThe version of the logical streaming replication protocol. Passing in unsupported protocol version numbers may lead to runtime errors.
binarybool?Send values in binary representation
streamingbool?Enable streaming of in-progress transactions. Setting this to true sets StreamingMode to On.
messagesbool?Write logical decoding messages into the replication stream
twoPhasebool?Enable streaming of prepared transactions
Properties
Binary
Send values in binary representation
public bool? Binary { get; }
Property Value
- bool?
Remarks
This works in PostgreSQL versions 14+
Messages
Write logical decoding messages into the replication stream
public bool? Messages { get; }
Property Value
- bool?
Remarks
This works in PostgreSQL versions 14+
ProtocolVersion
The version of the Logical Streaming Replication Protocol
public PgOutputProtocolVersion ProtocolVersion { get; }
Property Value
PublicationNames
The publication names to stream
public List<string> PublicationNames { get; }
Property Value
StreamingMode
Enable streaming of in-progress transactions
public PgOutputStreamingMode? StreamingMode { get; }
Property Value
Remarks
On works as of logical streaming replication protocol version 2 (PostgreSQL 14+), Parallel works as of logical streaming replication protocol version 4 (PostgreSQL 16+),
TwoPhase
Enable streaming of prepared transactions
public bool? TwoPhase { get; }
Property Value
- bool?
Remarks
This works in PostgreSQL versions 15+
Methods
Equals(PgOutputReplicationOptions?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(PgOutputReplicationOptions? other)
Parameters
otherPgOutputReplicationOptionsAn object to compare with this object.
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.