Internal system functions v5.6
The following are internal system functions. Many are used when creating various views. We recommend that you do not use the functions directly but instead use the views that they serve.
General internal functions
bdr.bdr_get_commit_decisions
Convenience routine to inspect shared memory state.
Synopsis
bdr.bdr_track_commit_decision
Save the transaction commit status in the shared memory hash table. This dunction is used by the upgrade scripts to transfer commit decisions saved in bdr.node_pre_commit catalog to the shared memory hash table. The transaction commit status will also be logged to the WAL and hence can be reloaded from WAL.
Synopsis
bdr.consensus_kv_fetch
Fetch value from the consistent KV Store in JSON format.
Synopsis
Parameters
Parameter | Description |
---|---|
key | An arbitrary key to fetch. |
Notes
This function is an internal function, mainly used by HARP.
Warning
Don't use this function in user applications.
bdr.consensus_kv_store
Stores value in the consistent KV Store.
Returns the timestamp of the value expiration time. This function depends on ttl
. If ttl
is NULL
, then this function returns infinity
. If the value was deleted, it
returns -infinity
.
Synopsis
Parameters
Parameter | Description |
---|---|
key | An arbitrary unique key to insert, update, or delete. |
value | JSON value to store. If NULL, any existing record is deleted. |
prev_value | If set, the write operation is done only if the current value is equal to prev_value . |
ttl | Time-to-live of the new value, in milliseconds. |
Notes
This is an internal function, mainly used by HARP.
Warning
Don't use this function in user applications.
bdr.decode_message_payload
PGD message payload function that decodes the payloads of consensus messages to a more human-readable output. Used primarily by the bdr.global_consensus_journal_details
debug view.
bdr.decode_message_response_payload
PGD message payload function that decodes the payloads of responses to consensus messages to a more human-readable output. Used primarily by the bdr.global_consensus_journal_details
debug view.
bdr.difference_fix_origin_create
Creates a replication origin with a given name passed as an argument but adding a bdr_
prefix.
Returns the internal id of the origin. This function has the same functionality
as pg_replication_origin_create()
except this function requires bdr_superuser
rather than postgres superuser permissions.
bdr.difference_fix_session_reset
Marks the current session as not replaying from any origin, essentially
resetting the effect of bdr.difference_fix_session_setup()
.
It returns void. This function has the same functionality as
pg_replication_origin_session_reset()
except this function requires
bdr_superuser rather than postgres superuser permissions.
Synopsis
bdr.difference_fix_session_setup
Marks the current session as replaying from the current origin.
The function uses the pre-created bdr_local_only_origin
local
replication origin implicitly for the session. It allows replay
progress to be reported and returns void. This function has the
same functionality as pg_replication_origin_session_setup()
except that this function requires bdr_superuser rather than postgres
superuser permissions. The earlier form of the function,
bdr.difference_fix_session_setup(text)
, was deprecated and will be
removed in a future release.
Synopsis
bdr.difference_fix_xact_set_avoid_conflict
Marks the current transaction as replaying a transaction that
committed at LSN '0/0' and timestamp '2000-01-01'. This function has
the same functionality as
pg_replication_origin_xact_setup('0/0', '2000-01-01')
except this function requires bdr_superuser rather than postgres superuser
permissions.