Struct NpgsqlLogSequenceNumber
Wraps a PostgreSQL Write-Ahead Log Sequence Number (see: https://www.postgresql.org/docs/current/datatype-pg-lsn.html)
Namespace: NpgsqlTypes
Assembly: Npgsql.dll
Syntax
public readonly struct NpgsqlLogSequenceNumber : IEquatable<NpgsqlLogSequenceNumber>, IComparable<NpgsqlLogSequenceNumber>
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
Constructors
| Improve this Doc View SourceNpgsqlLogSequenceNumber(ulong)
Initializes a new instance of NpgsqlLogSequenceNumber.
Declaration
public NpgsqlLogSequenceNumber(ulong value)
Parameters
Type | Name | Description |
---|---|---|
ulong | value | The value to wrap. |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
Fields
| Improve this Doc View SourceInvalid
Zero is used indicate an invalid Log Sequence Number. No XLOG record can begin at zero.
Declaration
public static readonly NpgsqlLogSequenceNumber Invalid
Field Value
Type | Description |
---|---|
NpgsqlLogSequenceNumber |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
Methods
| Improve this Doc View SourceCompareTo(NpgsqlLogSequenceNumber)
Compares this instance to a specified NpgsqlLogSequenceNumber and returns an indication of their relative values.
Declaration
public int CompareTo(NpgsqlLogSequenceNumber value)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlLogSequenceNumber | value | A NpgsqlLogSequenceNumber instance to compare to this instance. |
Returns
Type | Description |
---|---|
int | A signed number indicating the relative values of this instance and |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
Equals(NpgsqlLogSequenceNumber)
Returns a value indicating whether this instance is equal to a specified NpgsqlLogSequenceNumber instance.
Declaration
public bool Equals(NpgsqlLogSequenceNumber other)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlLogSequenceNumber | other | A NpgsqlLogSequenceNumber instance to compare to this instance. |
Returns
Type | Description |
---|---|
bool | true if the current instance is equal to the value parameter; otherwise, false. |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
Equals(object?)
Returns a value indicating whether this instance is equal to a specified object.
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
object? | obj | An object to compare to this instance |
Returns
Type | Description |
---|---|
bool | true if the current instance is equal to the value parameter; otherwise, false. |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer hash code. |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
Larger(NpgsqlLogSequenceNumber, NpgsqlLogSequenceNumber)
Returns the larger of two NpgsqlLogSequenceNumber values.
Declaration
public static NpgsqlLogSequenceNumber Larger(NpgsqlLogSequenceNumber value1, NpgsqlLogSequenceNumber value2)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlLogSequenceNumber | value1 | The first value to compare. |
NpgsqlLogSequenceNumber | value2 | The second value to compare. |
Returns
Type | Description |
---|---|
NpgsqlLogSequenceNumber | The larger of the two NpgsqlLogSequenceNumber values. |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
Parse(ReadOnlySpan<char>)
Converts the span representation of a Log Sequence Number to a NpgsqlLogSequenceNumber instance.
Declaration
public static NpgsqlLogSequenceNumber Parse(ReadOnlySpan<char> s)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<><char> | s | A span containing the characters that represent the Log Sequence Number to convert. |
Returns
Type | Description |
---|---|
NpgsqlLogSequenceNumber | A NpgsqlLogSequenceNumber equivalent to the Log Sequence Number specified in |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
Parse(string)
Converts the string representation of a Log Sequence Number to a NpgsqlLogSequenceNumber instance.
Declaration
public static NpgsqlLogSequenceNumber Parse(string s)
Parameters
Type | Name | Description |
---|---|---|
string | s | A string that represents the Log Sequence Number to convert. |
Returns
Type | Description |
---|---|
NpgsqlLogSequenceNumber | A NpgsqlLogSequenceNumber equivalent to the Log Sequence Number specified in |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
Smaller(NpgsqlLogSequenceNumber, NpgsqlLogSequenceNumber)
Returns the smaller of two NpgsqlLogSequenceNumber values.
Declaration
public static NpgsqlLogSequenceNumber Smaller(NpgsqlLogSequenceNumber value1, NpgsqlLogSequenceNumber value2)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlLogSequenceNumber | value1 | The first value to compare. |
NpgsqlLogSequenceNumber | value2 | The second value to compare. |
Returns
Type | Description |
---|---|
NpgsqlLogSequenceNumber | The smaller of the two NpgsqlLogSequenceNumber values. |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
ToString()
Converts the numeric value of this instance to its equivalent string representation.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | The string representation of the value of this instance, consisting of two hexadecimal numbers of up to 8 digits each, separated by a slash |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
TryParse(ReadOnlySpan<char>, out NpgsqlLogSequenceNumber)
Tries to convert the span representation of a Log Sequence Number to an NpgsqlLogSequenceNumber instance. A return value indicates whether the conversion succeeded or failed.
Declaration
public static bool TryParse(ReadOnlySpan<char> s, out NpgsqlLogSequenceNumber result)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<><char> | s | A span containing the characters that represent the Log Sequence Number to convert. |
NpgsqlLogSequenceNumber | result | When this method returns, contains a NpgsqlLogSequenceNumber instance equivalent to the Log Sequence
Number contained in |
Returns
Type | Description |
---|---|
bool | true if |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
TryParse(string, out NpgsqlLogSequenceNumber)
Tries to convert the string representation of a Log Sequence Number to an NpgsqlLogSequenceNumber instance. A return value indicates whether the conversion succeeded or failed.
Declaration
public static bool TryParse(string s, out NpgsqlLogSequenceNumber result)
Parameters
Type | Name | Description |
---|---|---|
string | s | A string that represents the Log Sequence Number to convert. |
NpgsqlLogSequenceNumber | result | When this method returns, contains a NpgsqlLogSequenceNumber instance equivalent to the Log Sequence
Number contained in |
Returns
Type | Description |
---|---|
bool | true if |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
Operators
| Improve this Doc View Sourceoperator +(NpgsqlLogSequenceNumber, double)
Add the number of bytes to a NpgsqlLogSequenceNumber instance, giving a new NpgsqlLogSequenceNumber instance. Handles both positive and negative numbers of bytes.
Declaration
public static NpgsqlLogSequenceNumber operator +(NpgsqlLogSequenceNumber lsn, double nbytes)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlLogSequenceNumber | lsn | The NpgsqlLogSequenceNumber instance representing a write-ahead log location. |
double | nbytes | The number of bytes to add. |
Returns
Type | Description |
---|---|
NpgsqlLogSequenceNumber | A new NpgsqlLogSequenceNumber instance. |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
operator ==(NpgsqlLogSequenceNumber, NpgsqlLogSequenceNumber)
Returns a value that indicates whether two specified instances of NpgsqlLogSequenceNumber are equal.
Declaration
public static bool operator ==(NpgsqlLogSequenceNumber value1, NpgsqlLogSequenceNumber value2)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlLogSequenceNumber | value1 | The first Log Sequence Number to compare. |
NpgsqlLogSequenceNumber | value2 | The second Log Sequence Number to compare. |
Returns
Type | Description |
---|---|
bool | true if |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
explicit operator ulong(NpgsqlLogSequenceNumber)
Converts the value of a NpgsqlLogSequenceNumber instance to a 64-bit unsigned integer value.
Declaration
public static explicit operator ulong(NpgsqlLogSequenceNumber value)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlLogSequenceNumber | value | A NpgsqlLogSequenceNumber instance |
Returns
Type | Description |
---|---|
ulong | The contents of |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
explicit operator NpgsqlLogSequenceNumber(ulong)
Converts the value of a 64-bit unsigned integer to a NpgsqlLogSequenceNumber instance.
Declaration
public static explicit operator NpgsqlLogSequenceNumber(ulong value)
Parameters
Type | Name | Description |
---|---|---|
ulong | value | A 64-bit unsigned integer. |
Returns
Type | Description |
---|---|
NpgsqlLogSequenceNumber | A new instance of NpgsqlLogSequenceNumber initialized to |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
operator >(NpgsqlLogSequenceNumber, NpgsqlLogSequenceNumber)
Returns a value indicating whether a specified NpgsqlLogSequenceNumber instance is greater than another specified NpgsqlLogSequenceNumber instance.
Declaration
public static bool operator >(NpgsqlLogSequenceNumber value1, NpgsqlLogSequenceNumber value2)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlLogSequenceNumber | value1 | The first value to compare. |
NpgsqlLogSequenceNumber | value2 | The second value to compare. |
Returns
Type | Description |
---|---|
bool | true if |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
operator >=(NpgsqlLogSequenceNumber, NpgsqlLogSequenceNumber)
Returns a value indicating whether a specified NpgsqlLogSequenceNumber instance is greater than or equal to another specified NpgsqlLogSequenceNumber instance.
Declaration
public static bool operator >=(NpgsqlLogSequenceNumber value1, NpgsqlLogSequenceNumber value2)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlLogSequenceNumber | value1 | The first value to compare. |
NpgsqlLogSequenceNumber | value2 | The second value to compare. |
Returns
Type | Description |
---|---|
bool | true if |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
operator !=(NpgsqlLogSequenceNumber, NpgsqlLogSequenceNumber)
Returns a value that indicates whether two specified instances of NpgsqlLogSequenceNumber are not equal.
Declaration
public static bool operator !=(NpgsqlLogSequenceNumber value1, NpgsqlLogSequenceNumber value2)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlLogSequenceNumber | value1 | The first Log Sequence Number to compare. |
NpgsqlLogSequenceNumber | value2 | The second Log Sequence Number to compare. |
Returns
Type | Description |
---|---|
bool | true if |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
operator <(NpgsqlLogSequenceNumber, NpgsqlLogSequenceNumber)
Returns a value indicating whether a specified NpgsqlLogSequenceNumber instance is less than another specified NpgsqlLogSequenceNumber instance.
Declaration
public static bool operator <(NpgsqlLogSequenceNumber value1, NpgsqlLogSequenceNumber value2)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlLogSequenceNumber | value1 | The first value to compare. |
NpgsqlLogSequenceNumber | value2 | The second value to compare. |
Returns
Type | Description |
---|---|
bool | true if |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
operator <=(NpgsqlLogSequenceNumber, NpgsqlLogSequenceNumber)
Returns a value indicating whether a specified NpgsqlLogSequenceNumber instance is less than or equal to another specified NpgsqlLogSequenceNumber instance.
Declaration
public static bool operator <=(NpgsqlLogSequenceNumber value1, NpgsqlLogSequenceNumber value2)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlLogSequenceNumber | value1 | The first value to compare. |
NpgsqlLogSequenceNumber | value2 | The second value to compare. |
Returns
Type | Description |
---|---|
bool | true if |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
operator -(NpgsqlLogSequenceNumber, NpgsqlLogSequenceNumber)
Subtracts two specified NpgsqlLogSequenceNumber values.
Declaration
public static ulong operator -(NpgsqlLogSequenceNumber first, NpgsqlLogSequenceNumber second)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlLogSequenceNumber | first | The first NpgsqlLogSequenceNumber value. |
NpgsqlLogSequenceNumber | second | The second NpgsqlLogSequenceNumber value. |
Returns
Type | Description |
---|---|
ulong | The number of bytes separating those write-ahead log locations. |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to
operator -(NpgsqlLogSequenceNumber, double)
Subtract the number of bytes from a NpgsqlLogSequenceNumber instance, giving a new NpgsqlLogSequenceNumber instance. Handles both positive and negative numbers of bytes.
Declaration
public static NpgsqlLogSequenceNumber operator -(NpgsqlLogSequenceNumber lsn, double nbytes)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlLogSequenceNumber | lsn | The NpgsqlLogSequenceNumber instance representing a write-ahead log location. |
double | nbytes | The number of bytes to subtract. |
Returns
Type | Description |
---|---|
NpgsqlLogSequenceNumber | A new NpgsqlLogSequenceNumber instance. |
Remarks
Log Sequence Numbers are a fundamental concept of the PostgreSQL Write-Ahead Log and by that of PostgreSQL replication. See https://www.postgresql.org/docs/current/wal-internals.html for what they represent.
This struct provides conversions from/to