spock.sync_seq
The upstream Spock manual covers 6.0.0-beta.2 and includes 5.0 maintenance notes. For deployment, configuration and recovery on Mimus, use Spock 5.0.15.
The spock.sync_seq() function synchronizes the current state of a sequence
to all subscribers.
Synopsis
Description
Captures the current value of a sequence on the provider node and pushes it into the replication stream so that subscribers can update their local copy to match. This ensures sequence values remain coordinated across nodes.
This function must be executed on the provider node. The sequence state update is embedded in the transaction where this function is called, and subscribers apply the update when they replicate that transaction.
Replication set filtering applies — only subscribers whose subscriptions include the replication set containing this sequence will receive the update.
Arguments
The function accepts the following argument:
relation- The name of the sequence to synchronize, optionally schema-qualified.
Example
In the following example, the spock.sync_seq() function synchronizes a
sequence named public.sales_order_no_seq:
Upstream source · d05e2e2b6a82 · Copyright (c) 2021–2026, pgEdge, Inc.; portions Copyright the PostgreSQL Global Development Group and The Regents of the University of California. PostgreSQL License.