Table of Contents

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

publicationNames IEnumerable<string>

The publication names to include into the stream

protocolVersion PgOutputProtocolVersion

The version of the logical streaming replication protocol

binary bool?

Send values in binary representation

streamingMode PgOutputStreamingMode?

Enable streaming of in-progress transactions

messages bool?

Write logical decoding messages into the replication stream

twoPhase bool?

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

publicationNames IEnumerable<string>

The publication names to include into the stream

protocolVersion ulong

The version of the logical streaming replication protocol. Passing in unsupported protocol version numbers may lead to runtime errors.

binary bool?

Send values in binary representation

streaming bool?

Enable streaming of in-progress transactions. Setting this to true sets StreamingMode to On.

messages bool?

Write logical decoding messages into the replication stream

twoPhase bool?

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

publicationName string

The publication names to include into the stream

protocolVersion PgOutputProtocolVersion

The version of the logical streaming replication protocol

binary bool?

Send values in binary representation

streamingMode PgOutputStreamingMode?

Enable streaming of in-progress transactions

messages bool?

Write logical decoding messages into the replication stream

twoPhase bool?

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

publicationName string

The publication names to include into the stream

protocolVersion ulong

The version of the logical streaming replication protocol. Passing in unsupported protocol version numbers may lead to runtime errors.

binary bool?

Send values in binary representation

streaming bool?

Enable streaming of in-progress transactions. Setting this to true sets StreamingMode to On.

messages bool?

Write logical decoding messages into the replication stream

twoPhase bool?

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

PgOutputProtocolVersion

PublicationNames

The publication names to stream

public List<string> PublicationNames { get; }

Property Value

List<string>

StreamingMode

Enable streaming of in-progress transactions

public PgOutputStreamingMode? StreamingMode { get; }

Property Value

PgOutputStreamingMode?

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

other PgOutputReplicationOptions

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.