Skip to main content

Crate rupg_common

Crate rupg_common 

Source
Expand description

Error with its SqlState, the identifiers Oid, ShardId, RowId, Hlc, Xid and Lsn of document 04 section 4.7, CompatVersion, and qsort, the sort of PostgreSQL.

This crate first ships in milestone M1. See spec/22-crate-layout.md section 22.4 and spec/23-milestones.md.

Structs§

Error
Hlc
A hybrid logical clock value, 64 bits: 48 bits of milliseconds since 1 January 2020 UTC in the high bits and a 16-bit logical counter in the low bits.
Lsn
A pg_lsn value. rupg has no single log, so the LSN that clients see is the commit timestamp of the newest durable commit (spec/04 section 4.7). It is monotonic and 64 bits wide.
Oid
An object id, 32 bits, as in PostgreSQL.
RowId
A row id, 64 bits: the shard in the high 16 bits and a local number in the low 48 bits.
ShardId
A shard number, 16 bits. A single node has shard 0.
SqlState
A SQLSTATE: five ASCII characters, each a digit or an upper case letter.
UnknownVersion
The error when a string does not name a supported version.
Xid
A transaction id, 64 bits, local to the node, assigned at the first write.

Enums§

Category
What a code means for the statement, from the second column of errcodes.txt.
CompatVersion
A PostgreSQL major version that rupg.compat_version can name.
Level
The level of a message that is not an error, from the lowest to the highest.
Object
A name of the object of an error, as errtable, errtablecol, errdatatype and errconstraint give it. A client reads it from the field with the code of Object::code.

Constants§

POSTGRES_COMMIT
The commit of the PostgreSQL pin on REL_19_STABLE.
POSTGRES_PIN
The PostgreSQL release that rupg follows. See spec/05-compatibility.md.

Functions§

qsort
pg_qsort: a quicksort with the median of three or of nine, a partition in three parts and an insertion sort for fewer than 7 items. It is not stable. The sort stops at the first error of cmp.

Type Aliases§

Result
The result type of rupg.