User visible catalogs and views v5.6

Catalogs and views are listed here in alphabetical order.

bdr.camo_decision_journal

A persistent journal of decisions resolved by a CAMO partner node after a failover, in case bdr.logical_transaction_status was invoked. Unlike bdr.node_pre_commit, this doesn't cover transactions processed under normal operational conditions (that is, both nodes of a CAMO pair are running and connected). Entries in this journal aren't ever cleaned up automatically. This is a diagnostic tool that the system doesn't depend on.

bdr.camo_decision_journal columns

NameTypeDescription
origin_node_idoidOID of the node where the transaction executed
origin_xidoidTransaction ID on the remote origin node
decisionchar'c' for commit, 'a' for abort
decision_tstimestamptzDecision time

bdr.commit_scopes

Catalog storing all possible commit scopes that you can use for bdr.commit_scope to enable Group Commit.

bdr.commit_scopes columns

NameTypeDescription
commit_scope_idoidID of the scope to be referenced
commit_scope_namenameName of the scope to be referenced
commit_scope_origin_node_groupoidNode group for which the rule applies, referenced by ID
sync_scope_ruletextDefinition of the scope

bdr.conflict_history

This table is the default table where conflicts are logged. The table is RANGE partitioned on column local_time and is managed by Autopartition. The default data retention period is 30 days.

Access to this table is possible by any table owner, who can see all conflicts for the tables they own, restricted by row-level security.

For details, see Logging conflicts to a table.

bdr.conflict_history columns

NameTypeDescription
sub_idoidSubscription that produced this conflict; can be joined to bdr.subscription table
origin_node_idoidOID (as seen in the pg_replication_origin catalog) of the node that produced the conflicting change
local_xidxidLocal transaction of the replication process at the time of conflict
local_lsnpg_lsnLocal LSN at the time of conflict
local_timetimestamp with time zoneLocal time of the conflict
remote_xidxidTransaction that produced the conflicting change on the remote node (an origin)
remote_change_nroidIndex of the change within its transaction
remote_commit_lsnpg_lsnCommit LSN of the transaction which produced the conflicting change on the remote node (an origin)
remote_commit_timetimestamp with time zoneCommit timestamp of the transaction that produced the conflicting change on the remote node (an origin)
conflict_typetextDetected type of the conflict
conflict_resolutiontextConflict resolution chosen
conflict_indexregclassConflicting index (valid only if the index wasn't dropped since)
reloidoidConflicting relation (valid only if the index wasn't dropped since)
nspnametextName of the schema for the relation on which the conflict has occurred at the time of conflict (doesn't follow renames)
relnametextName of the relation on which the conflict has occurred at the time of conflict (does not follow renames)
key_tuplejsonJson representation of the key used for matching the row
remote_tuplejsonJson representation of an incoming conflicting row
local_tuplejsonJson representation of the local conflicting row
apply_tuplejsonJson representation of the resulting (the one that has been applied) row
local_tuple_xminxidTransaction that produced the local conflicting row (if local_tuple is set and the row isn't frozen)
local_tuple_node_idoidNode that produced the local conflicting row (if local_tuple is set and the row isn't frozen)
local_tuple_commit_timetimestamp with time zoneLast-known-change timestamp of the local conflicting row (if local_tuple is set and the row isn't frozen)

bdr.conflict_history_summary

A view containing user-readable details on row conflict.

bdr.conflict_history_summary columns

NameTypeDescription
nspnametextName of the schema
relnametextName of the table
origin_node_idoidOID (as seen in the pg_replication_origin catalog) of the node that produced the conflicting change
remote_commit_lsnpg_lsnCommit LSN of the transaction which produced the conflicting change on the remote node (an origin)
remote_change_nroidIndex of the change within its transaction
local_timetimestamp with time zoneLocal time of the conflict
local_tuple_commit_timetimestamp with time zoneTime of local commit
remote_commit_timetimestamp with time zoneTime of remote commit
conflict_typetextType of conflict
conflict_resolutiontextResolution adopted

bdr.consensus_kv_data

A persistent storage for the internal Raft-based KV store used by bdr.consensus_kv_store() and bdr.consensus_kv_fetch() interfaces.

bdr.consensus_kv_data Columns

NameTypeDescription
kv_keytextUnique key
kv_valjsonArbitrary value in json format
kv_create_tstimestamptzLast write timestamp
kv_ttlintTime to live for the value in milliseconds
kv_expire_tstimestamptzExpiration timestamp (kv_create_ts + kv_ttl)

bdr.crdt_handlers

This table lists merge ("handlers") functions for all CRDT data types.

bdr.crdt_handlers Columns

NameTypeDescription
crdt_type_idregtypeCRDT data type ID
crdt_merge_idregprocMerge function for this data type

bdr.ddl_replication

This view lists DDL replication configuration as set up by current DDL filters.

bdr.ddl_replication columns

NameTypeDescription
set_ddl_namenameName of DDL filter
set_ddl_tagtextCommand tags it applies on (regular expression)
set_ddl_roletextRoles it applies to (regular expression)
set_namenameName of the replication set for which this filter is defined

bdr.depend

This table tracks internal object dependencies inside PGD catalogs.

bdr.global_consensus_journal

This catalog table logs all the Raft messages that were sent while managing global consensus.

As for the bdr.global_consensus_response_journal catalog, the payload is stored in a binary encoded format, which can be decoded with the bdr.decode_message_payload() function. See the bdr.global_consensus_journal_details view for more details.

bdr.global_consensus_journal columns

NameTypeDescription
log_indexint8ID of the journal entry
termint8Raft term
originoidID of node where the request originated
req_idint8ID for the request
req_payloadbyteaPayload for the request
trace_contextbyteaTrace context for the request

bdr.global_consensus_journal_details

This view presents Raft messages that were sent and the corresponding responses, using the bdr.decode_message_payload() function to decode their payloads.

bdr.global_consensus_journal_details columns

NameTypeDescription
node_group_namenameName of the node group
log_indexint8ID of the journal entry
termint8Raft term
request_idint8ID of the request
origin_idoidID of the node where the request originated
req_payloadbyteaPayload of the request
origin_node_namenameName of the node where the request originated
message_type_nooidID of the PGD message type for the request
message_typetextName of the PGD message type for the request
message_payloadtextPGD message payload for the request
response_message_type_nooidID of the PGD message type for the response
response_message_typetextName of the PGD message type for the response
response_payloadtextPGD message payload for the response
response_errcode_notextSQLSTATE for the response
response_errcodetextError code for the response
response_messagetextError message for the response

bdr.global_consensus_response_journal

This catalog table collects all the responses to the Raft messages that were received while managing global consensus.

As for the bdr.global_consensus_journal catalog, the payload is stored in a binary-encoded format, which can be decoded with the bdr.decode_message_payload() function. See the bdr.global_consensus_journal_details view for more details.

bdr.global_consensus_response_journal columns

NameTypeDescription
log_indexint8ID of the journal entry
res_statusoidStatus code for the response
res_payloadbyteaPayload for the response
trace_contextbyteaTrace context for the response

bdr.global_lock

This catalog table stores the information needed for recovering the global lock state on server restart.

For monitoring usage, the bdr.global_locks view is preferable because the visible rows in bdr.global_lock don't necessarily reflect all global locking activity.

Don't modify the contents of this table. It is an important PGD catalog.

bdr.global_lock columns

NameTypeDescription
ddl_epochint8DDL epoch for the lock
origin_node_idoidOID of the node where the global lock has originated
lock_typeoidType of the lock (DDL or DML)
nspnamenameSchema name for the locked relation
relnamenameRelation name for the locked relation
groupidoidOID of the top level group (for Advisory locks)
key1integerFirst 32-bit key or lower order 32-bits of 64-bit key (for advisory locks)
key2integerSecond 32-bit key or higher order 32-bits of 64-bit key (for advisory locks)
key_is_bigintbooleanTrue if 64-bit integer key is used (for advisory locks)

bdr.global_locks

A view containing active global locks on this node. The bdr.global_locks view exposes PGD's shared-memory lock state tracking, giving administrators greater insight into PGD's global locking activity and progress.

See Monitoring global locks for more information about global locking.

bdr.global_locks columns

NameTypeDescription
origin_node_idoidOID of the node where the global lock has originated
origin_node_namenameName of the node where the global lock has originated
lock_typetextType of the lock (DDL or DML)
relationtextLocked relation name (for DML locks) or keys (for advisory locks)
pidint4PID of the process holding the lock
acquire_stagetextInternal state of the lock acquisition process
waitersint4List of backends waiting for the same global lock
global_lock_request_timetimestamptzTime this global lock acquire was initiated by origin node
local_lock_request_timetimestamptzTime the local node started trying to acquire the local lock
last_state_change_timetimestamptzTime acquire_stage last changed

Column details:

  • relation: For DML locks, relation shows the relation on which the DML lock is acquired. For global advisory locks, relation column actually shows the two 32-bit integers or one 64-bit integer on which the lock is acquired.

  • origin_node_id and origin_node_name: If these are the same as the local node's ID and name, then the local node is the initiator of the global DDL lock, that is, it is the node running the acquiring transaction. If these fields specify a different node, then the local node is instead trying to acquire its local DDL lock to satisfy a global DDL lock request from a remote node.

  • pid: The process ID of the process that requested the global DDL lock, if the local node is the requesting node. Null on other nodes. Query the origin node to determine the locker pid.

  • global_lock_request_time: The timestamp at which the global-lock request initiator started the process of acquiring a global lock. Can be null if unknown on the current node. This time is stamped at the beginning of the DDL lock request and includes the time taken for DDL epoch management and any required flushes of pending-replication queues. Currently only known on origin node.

  • local_lock_request_time: The timestamp at which the local node started trying to acquire the local lock for this global lock. This includes the time taken for the heavyweight session lock acquire but doesn't include any time taken on DDL epochs or queue flushing. If the lock is reacquired after local node restart, it becomes the node restart time.

  • last_state_change_time: The timestamp at which the bdr.global_locks.acquire_stage field last changed for this global lock entry.

bdr.group_camo_details

Uses bdr.run_on_all_nodes to gather CAMO-related information from all nodes.

bdr.group_camo_details columns

NameTypeDescription
node_idtextInternal node ID
node_nametextName of the node
camo_partnertextNode name of the camo partner
is_camo_partner_connectedtextConnection status
is_camo_partner_readytextReadiness status
camo_transactions_resolvedtextAre there any pending and unresolved CAMO transactions
apply_lsntextLatest position reported as replayed (visible)
receive_lsntextLatest LSN of any change or message received (can go backwards in case of restarts)
apply_queue_sizetextBytes difference between apply_lsn and receive_lsn

bdr.group_raft_details

Uses bdr.run_on_all_nodes to gather Raft Consensus status from all nodes.

bdr.group_raft_details columns

NameTypeDescription
node_idoidInternal node ID
node_namenameName of the node
node_group_namenameName of the group is part of
statetextRaft worker state on the node
leader_idoidNode id of the RAFT_LEADER
current_termintRaft election internal ID
commit_indexintRaft snapshot internal ID
nodesintNumber of nodes accessible
voting_nodesintNumber of nodes voting
protocol_versionintProtocol version for this node

bdr.group_replslots_details

Uses bdr.run_on_all_nodes to gather PGD slot information from all nodes.

bdr.group_replslots_details columns

NameTypeDescription
node_group_nametextName of the PGD group
origin_nametextName of the origin node
target_nametextName of the target node
slot_nametextSlot name on the origin node used by this subscription
activetextIs the slot active (does it have a connection attached to it)
statetextState of the replication (catchup, streaming, ...) or 'disconnected' if offline
write_lagintervalApproximate lag time for reported write
flush_lagintervalApproximate lag time for reported flush
replay_lagintervalApproximate lag time for reported replay
sent_lag_bytesint8Bytes difference between sent_lsn and current WAL write position
write_lag_bytesint8Bytes difference between write_lsn and current WAL write position
flush_lag_bytesint8Bytes difference between flush_lsn and current WAL write position
replay_lag_byteint8Bytes difference between replay_lsn and current WAL write position

bdr.group_subscription_summary

Uses bdr.run_on_all_nodes to gather subscription status from all nodes.

bdr.group_subscription_summary columns

NameTypeDescription
origin_node_nametextName of the origin of the subscription
target_node_nametextName of the target of the subscription
last_xact_replay_timestamptextTimestamp of the last replayed transaction
sub_lag_secondstextLag between now and last_xact_replay_timestamp

bdr.group_versions_details

Uses bdr.run_on_all_nodes to gather PGD information from all nodes.

bdr.group_versions_details columns

NameTypeDescription
node_idoidInternal node ID
node_namenameName of the node
postgres_versiontextPostgreSQL version on the node
bdr_versiontextPGD version on the node

bdr.local_consensus_snapshot

This catalog table contains consensus snapshots created or received by the local node.

bdr.local_consensus_snapshot columns

NameTypeDescription
log_indexint8ID of the journal entry
log_termint8Raft term
snapshotbyteaRaft snapshot data

bdr.local_consensus_state

This catalog table stores the current state of Raft on the local node.

bdr.local_consensus_state columns

NameTypeDescription
node_idoidID of the node
current_termint8Raft term
apply_indexint8Raft apply index
voted_foroidVote cast by this node in this term
last_known_leaderoidnode_id of last known Raft leader

bdr.local_node

This table identifies the local node in the current database of the current Postgres instance.

bdr.local_node columns

NameTypeDescription
node_idoidID of the node
pub_repsetstext[]Published replication sets
sub_repsetstext[]Subscribed replication sets

bdr.local_node_summary

A view containing the same information as bdr.node_summary (plus pub_repsets and sub_repsets), but only for the local node.

bdr.local_sync_status

Information about status of either subscription or table synchronization process.

bdr.local_sync_status columns

NameTypeDescription
sync_kindcharKind of synchronization done
sync_subidoidID of subscription doing the synchronization
sync_nspnamenameSchema name of the synchronized table (if any)
sync_relnamenameName of the synchronized table (if any)
sync_statuscharCurrent state of the synchronization
sync_remote_relidoidID of the synchronized table (if any) on the upstream
sync_end_lsnpg_lsnPosition at which the synchronization state last changed

bdr.node

This table lists all the PGD nodes in the cluster.

The view bdr.node_summary provides a human-readable version of most of the columns from bdr.node.

bdr.node columns

NameTypeDescription
node_idoidID of the node
node_namenameName of the node
node_group_idoidID of the node group
source_node_idoidID of the source node
synchronize_structure"char"Schema synchronization done during the join
node_stateoidConsistent state of the node
target_stateoidState that the node is trying to reach (during join or promotion)
seq_idint4Sequence identifier of the node used for generating unique sequence numbers
dbnamenameDatabase name of the node
node_dsncharConnection string for the node
proto_version_rangesint[]Supported protocol version ranges by the node
generationsmallintCounter incremented when a node joins with the same name as a previous node
node_kindoidID of the node kind
node_join_finishedbooleanCheck if the join is finished

bdr.node_catchup_info

This catalog table records relevant catchup information on each node, either if it is related to the join or part procedure.

bdr.node_catchup_info columns

NameTypeDescription
node_idoidID of the node
node_source_idoidID of the node used as source for the data
slot_namenameSlot used for this source
min_node_lsnpg_lsnMinimum LSN at which the node can switch to direct replay from a peer node
catchup_stateoidStatus code of the catchup state
origin_node_idoidID of the node from which we want transactions

If a node(node_id) needs missing data from a parting node(origin_node_id), it can get it from a node that already has it(node_source_id) by forwarding. The records in this table persists until the node(node_id) is a member of the EDB Postgres Distributed cluster.

bdr.node_catchup_info_details

A view of bdr.node_catchup_info catalog which shows info in more friendly way

bdr.node_conflict_resolvers

Currently configured conflict resolution for all known conflict types.

bdr.node_conflict_resolvers columns

NameTypeDescription
conflict_typetextType of the conflict
conflict_resolvertextResolver used for this conflict type

bdr.node_group

This catalog table lists all the PGD node groups. See also bdr.node_group_summary for a view containing user-readable details.

bdr.node_group columns

NameTypeDescription
node_group_idoidID of the node group
node_group_namenameName of the node group
node_group_default_repsetoidDefault replication set for this node group
node_group_default_repset_extoidDefault replication set for this node group
node_group_parent_idoidID of parent group (0 if this is a root group)
node_group_flagsintGroup flags
node_group_uuiduuidThe uuid of the group
node_group_apply_delayintervalHow long a subscriber waits before applying changes from the provider
node_group_check_constraintsboolWhether the apply process checks constraints when applying data
node_group_num_writersintNumber of writers to use for subscriptions backing this node group
node_group_enable_wal_decoderboolWhether the group has enable_wal_decoder set
node_group_streaming_modecharTransaction streaming setting: 'O' - off, 'F' - file, 'W' - writer, 'A' - auto, 'D' - default
node_group_default_commit_scopeoidID of the node group's default commit scope
node_group_locationcharName of the location associated with the node group
node_group_enable_proxy_routingcharWhether the node group allows routing from pgd-proxy
node_group_enable_raftboolWhether the node group allows Raft Consensus

bdr.node_group_replication_sets

A view showing default replication sets create for PGD groups. See also bdr.replication_sets.

bdr.node_group_replication_sets columns

NameTypeDescription
node_group_namenameName of the PGD group
def_repsetnameName of the default repset
def_repset_opstext[]Actions replicated by the default repset
def_repset_extnameName of the default "external" repset (usually same as def_repset)
def_repset_ext_opstext[]Actions replicated by the default "external" repset (usually same as def_repset_ops)

bdr.node_group_summary

A view containing user-readable details about node groups. See also bdr.node_group.

bdr.node_group_summary columns

NameTypeDescription
node_group_namenameName of the node group
default_repsetnameDefault replication set for this node group
parent_group_namenameName of parent group (NULL if this is a root group)
node_group_typetextType of the node group (one of "global", "data", "shard" or "subscriber-only")
apply_delayintervalHow long a subscriber waits before applying changes from the provider
check_constraintsbooleanWhether the apply process checks constraints when applying data
num_writersintegerNumber of writers to use for subscriptions backing this node group
enable_wal_decoderbooleanWhether the group has enable_wal_decoder set
streaming_modetextTransaction streaming setting: "off", "file", "writer", "auto" or "default"
default_commit_scopenameName of the node group's default commit scope
locationnameName of the location associated with the node group
enable_proxy_routingbooleanWhether the node group allows routing from pgd-proxy
enable_raftbooleanWhether the node group allows Raft Consensus
route_writer_max_lagbigintMaximum write lag accepted
route_reader_max_lagbigintMaximum read lag accepted
route_writer_wait_flushbooleanSwitch if we need to wait for the flush

bdr.node_local_info

A catalog table used to store per-node configuration that's specific to the local node (as opposed to global view of per-node configuration).

bdr.node_local_info columns

NameTypeDescription
node_idoidThe OID of the node (including the local node)
applied_stateoidInternal ID of the node state
ddl_epochint8Last epoch number processed by the node
slot_namenameName of the slot used to connect to that node (NULL for the local node)

bdr.node_log_config

A catalog view that stores information on the conflict logging configurations.

bdr.node_log_config columns

NameDescription
log_nameName of the logging configuration
log_to_fileWhether it logs to the server log file
log_to_tableWhether it logs to a table, and which table is the target
log_conflict_typeWhich conflict types it logs, if NULL means all
log_conflict_resWhich conflict resolutions it logs, if NULL means all

bdr.node_peer_progress

Catalog used to keep track of every node's progress in the replication stream. Every node in the cluster regularly broadcasts its progress every bdr.replay_progress_frequency milliseconds to all other nodes (default is 60000 ms, that is, 1 minute). Expect N * (N-1) rows in this relation.

You might be more interested in the bdr.node_slots view for monitoring purposes. See also Monitoring.

bdr.node_peer_progress columns

NameTypeDescription
node_idoidOID of the originating node that reported this position info
peer_node_idoidOID of the node's peer (remote node) for which this position info was reported
last_update_sent_timetimestamptzTime at which the report was sent by the originating node
last_update_recv_timetimestamptzTime at which the report was received by the local server
last_update_node_lsnpg_lsnLSN on the originating node at the time of the report
peer_positionpg_lsnLatest LSN of the node's peer seen by the originating node
peer_replay_timetimestamptzLatest replay time of peer seen by the reporting node
last_update_horizon_xidoidInternal resolution horizon: all lower xids are known resolved on the reporting node
last_update_horizon_lsnpg_lsnInternal resolution horizon: same in terms of an LSN of the reporting node

bdr.node_replication_rates

This view contains information about outgoing replication activity from a given node.

bdr.node_replication_rates columns

ColumnTypeDescription
peer_node_idoidOID of node's peer (remote node) for which this info was reported
target_namenameName of the target peer node
sent_lsnpg_lsnLatest sent position
replay_lsnpg_lsnLatest position reported as replayed (visible)
replay_lagintervalApproximate lag time for reported replay
replay_lag_bytesint8Bytes difference between replay_lsn and current WAL write position on origin
replay_lag_sizetextHuman-readable bytes difference between replay_lsn and current WAL write position
apply_ratebigintLSNs being applied per second at the peer node
catchup_intervalintervalApproximate time required for the peer node to catch up to all the changes that are yet to be applied
Note

The replay_lag is set immediately to zero after reconnect. As a workaround, use replay_lag_bytes, replay_lag_size, or catchup_interval.

bdr.node_slots

This view contains information about replication slots used in the current database by PGD.

See Monitoring outgoing replication for guidance on the use and interpretation of this view's fields.

bdr.node_slots columns

NameTypeDescription
target_dbnamenameDatabase name on the target node
node_group_namenameName of the PGD group
node_group_idoidOID of the PGD group
origin_namenameName of the origin node
target_namenameName of the target node
origin_idoidOID of the origin node
target_idoidOID of the target node
local_slot_namenameName of the replication slot according to PGD
slot_namenameName of the slot according to Postgres (same as above)
is_group_slotbooleanTrue if the slot is the node-group crash recovery slot for this node (see ["Group Replication Slot"](nodes#Group Replication Slot))
is_decoder_slotbooleanIs this slot used by the decoding worker feature
pluginnameLogical decoding plugin using this slot (should be pglogical_output or bdr)
slot_typetextType of the slot (should be logical)
datoidoidOID of the current database
databasenameName of the current database
temporaryboolIs the slot temporary
activeboolIs the slot active (does it have a connection attached to it)
active_pidint4PID of the process attached to the slot
xminxidXID needed by the slot
catalog_xminxidCatalog XID needed by the slot
restart_lsnpg_lsnLSN at which the slot can restart decoding
confirmed_flush_lsnpg_lsnLatest confirmed replicated position
usesysidoidsysid of the user the replication session is running as
usenamenameusername of the user the replication session is running as
application_nametextApplication name of the client connection (used by synchronous_standby_names)
client_addrinetIP address of the client connection
client_hostnametextHostname of the client connection
client_portint4Port of the client connection
backend_starttimestamptzWhen the connection started
statetextState of the replication (catchup, streaming, ...) or 'disconnected' if offline
sent_lsnpg_lsnLatest sent position
write_lsnpg_lsnLatest position reported as written
flush_lsnpg_lsnLatest position reported as flushed to disk
replay_lsnpg_lsnLatest position reported as replayed (visible)
write_lagintervalApproximate lag time for reported write
flush_lagintervalApproximate lag time for reported flush
replay_lagintervalApproximate lag time for reported replay
sent_lag_bytesint8Bytes difference between sent_lsn and current WAL write position
write_lag_bytesint8Bytes difference between write_lsn and current WAL write position
flush_lag_bytesint8Bytes difference between flush_lsn and current WAL write position
replay_lag_bytesint8Bytes difference between replay_lsn and current WAL write position
sent_lag_sizetextHuman-readable bytes difference between sent_lsn and current WAL write position
write_lag_sizetextHuman-readable bytes difference between write_lsn and current WAL write position
flush_lag_sizetextHuman-readable bytes difference between flush_lsn and current WAL write position
replay_lag_sizetextHuman-readable bytes difference between replay_lsn and current WAL write position
Note

The replay_lag is set immediately to zero after reconnect. As a workaround, use replay_lag_bytes or replay_lag_size.

bdr.node_summary

This view contains summary information about all PGD nodes known to the local node.

bdr.node_summary columns

NameTypeDescription
node_namenameName of the node
node_group_namenameName of the PGD group the node is part of
interface_connstrtextConnection string to the node
peer_state_nametextConsistent state of the node in human readable form
peer_target_state_nametextState that the node is trying to reach (during join or promotion)
node_seq_idint4Sequence identifier of the node used for generating unique sequence numbers
node_local_dbnamenameDatabase name of the node
node_idoidOID of the node
node_group_idoidOID of the PGD node group
node_kind_nameoidNode kind name

bdr.queue

This table stores the historical record of replicated DDL statements.

bdr.queue columns

NameTypeDescription
queued_attimestamptzWhen was the statement queued
rolenameWhich role has executed the statement
replication_setstext[]Which replication sets was the statement published to
message_typecharType of a message. Possible values:
A - Table sync
D - DDL
S - Sequence
T - Truncate
Q - SQL statement
messagejsonPayload of the message needed for replication of the statement

bdr.replication_set

A table that stores replication set configuration. For user queries, we recommend instead checking the bdr.replication_sets view.

bdr.replication_set columns

NameTypeDescription
set_idoidOID of the replication set
set_nodeidoidOID of the node (always local node oid currently)
set_namenameName of the replication set
replicate_insertbooleanIndicates if the replication set replicates INSERTs
replicate_updatebooleanIndicates if the replication set replicates UPDATEs
replicate_deletebooleanIndicates if the replication set replicates DELETEs
replicate_truncatebooleanIndicates if the replication set replicates TRUNCATEs
set_isinternalbooleanReserved
set_autoadd_tablesbooleanIndicates if new tables are automatically added to this replication set
set_autoadd_seqsbooleanIndicates if new sequences are automatically added to this replication set

bdr.replication_set_table

A table that stores replication set table membership. For user queries, we recommend instead checking the bdr.tables view.

bdr.replication_set_table columns

NameTypeDescription
set_idoidOID of the replication set
set_reloidregclassLocal ID of the table
set_att_listtext[]Reserved
set_row_filterpg_node_treeCompiled row filtering expression

bdr.replication_set_ddl

A table that stores replication set ddl replication filters. For user queries, we recommend instead checking the bdr.ddl_replication view.

bdr.replication_set_ddl Columns

NameTypeDescription
set_idoidOID of the replication set
set_ddl_namenameName of the DDL filter
set_ddl_tagtextCommand tag for the DDL filter
set_ddl_roletextRole executing the DDL

bdr.replication_sets

A view showing replication sets defined in the PGD group, even if they aren't currently used by any node.

bdr.replication_sets columns

NameTypeDescription
set_idoidOID of the replication set
set_namenameName of the replication set
replicate_insertbooleanIndicates if the replication set replicates INSERTs
replicate_updatebooleanIndicates if the replication set replicates UPDATEs
replicate_deletebooleanIndicates if the replication set replicates DELETEs
replicate_truncatebooleanIndicates if the replication set replicates TRUNCATEs
set_autoadd_tablesbooleanIndicates if new tables are automatically added to this replication set
set_autoadd_seqsbooleanIndicates if new sequences are automatically added to this replication set

bdr.schema_changes

A simple view to show all the changes to schemas win PGD.

bdr.schema_changes columns

NameTypeDescription
schema_changes_tstimestampstzID of the trigger
schema_changes_changecharFlag of change type
schema_changes_classidoidClass ID
schema_changes_objectidoidObject ID
schema_changes_subidsmallintSubscription
schema_changes_descrtextObject changed
schema_changes_addrnamestext[]Location of schema change

bdr.sequence_alloc

A view to see the allocation details for galloc sequences.

bdr.sequence_alloc columns

NameTypeDescription
seqidregclassID of the sequence
seq_chunk_sizebigintA sequence number for the chunk within its value
seq_allocated_up_tobigint
seq_nallocsbigint
seq_last_alloctimestamptzLast sequence allocated

bdr.sequences

This view lists all sequences with their kind, excluding sequences for internal PGD bookkeeping.

bdr.sequences columns

NameTypeDescription
nspnamenameNamespace containing the sequence
relnamenameName of the sequence
seqkindtextType of the sequence ('local', 'timeshard', 'galloc')

bdr.stat_activity

Dynamic activity for each backend or worker process.

This contains the same information as pg_stat_activity, except wait_event is set correctly when the wait relates to PGD.

bdr.stat_commit_scope

A view containing statistics for each commit scope.

bdr.stat_commit_scope columns

ColumnTypeDescription
commit_scope_namenameName of the commit scope
group_namenameName of group for which the commit scope is defined
ncallsbigintThe number of times the commit scope was used
ncommitsbigintThe number of successful commits were made with the commit scope
nabortsbigintThe number of times the commit scope used was eventually aborted
total_commit_timedouble precisionTotal time spent committing using the commit scope, in milliseconds
min_commit_timedouble precisionMinimum time spent committing using the commit scope, in milliseconds
max_commit_timedouble precisionMaximum time spend committing using the commit scope, in milliseconds
mean_commit_timedouble precisionMean time spent committing using the commit scope, in milliseconds
stats_resettimestamp with time zoneTime at which all statistics in the view were last reset

bdr.stat_commit_scope_state

A view of information about the current use of commit scopes by backends.

bdr.stat_commit_scope_state columns

ColumnTypeDescription
pidintegerProcess ID of the backend
commit_scope_namenameName of the commit scope being used
group_namenameName of group for which the commit scope is defined
waiting_op_numintegerIndex of the first operation in the commit scope that is not satisfied yet
waiting_prepare_confirmationsintegerThe number of PREPARE confirmations that are still needed by the operation
waiting_commit_confirmationsintegerThe number of COMMIT confirmations that are still needed by the operation
waiting_lsn_confirmationsintegerThe number of LSN confirmations that are still needed by the operation

bdr.stat_raft_followers_state

A view of the state of the raft leader's followers on the Raft leader node (empty on other nodes).

bdr.stat_raft_followers_state columns

ColumnTypeDescription
group_namenameThe group this information is for (each group can have a separate consensus configured)
node_namenameName of the follower node
sent_commit_indexbigintLatest Raft index sent to the follower node
match_indexbigintRaft index we expect to match the next response from the follower node
last_message_timetimestamp with time zoneLast message (any, including requests) seen from the follower node
last_heartbeat_send_timetimestamp with time zoneLast time the leader sent heartbeat to the follower node
last_heartbeat_response_timeLasat time the leader has seen a heartbeat response from the follower node
approx_clock_drift_msbigintApproximate clock drift seen by the leader against the follower node in milliseconds

bdr.stat_raft_state

A view describing the state of the Raft consensus on the local node.

bdr.stat_raft_state columns

ColumnTypeDescription
group_namenameThe group this information is for (each group can have a separate consensus configured)
raft_stattextState of the local node in the Raft ('LEADER', 'CANDIDATE', 'FOLLOWER', 'STOPPED')
leader_namenameName of the Raft leader, if any
voted_for_namenameThe node the local node voted for as leader last vote
is_votingbooleanThe local node part of Raft is voting
heartbeat_timeout_msbigintThe heartbeat timeout on the local node
heartbeat_elapsed_msbigintThe number of milliseconds that have elapsed since the local node has seen a heartbeat from the leader
current_termbigintThe current Raft term the local node is at
commit_indexbigintThe current Raft commit index the local node is at
apply_indexbigintThe Raft commit index the local node applied to catalogs
last_log_termbigintLast Raft term in the request log
last_log_indexbigintLast Raft index in the request log
oldest_log_indexbigintOldest Raft index still in the request log
newest_prunable_log_indexbigintNewest Raft index that can be safely removed from the request log
snapshot_termbigintRaft term of the last snapshot
snapshot_indexbigintRaft index of the last snapshot
nnodesintegerNumber of nodes in the Raft consensus (should normally be the same as the number of nodes in the group)
nvoting_nodesintegerNumber of voting nodes in the Raft consensus

bdr.stat_receiver

A view containing all the necessary info about the replication subscription receiver processes.

bdr.stat_receiver columns

ColumnTypeDescription
worker_roletextRole of the BDR worker (always 'receiver')
worker_statetextState of receiver worker (can be 'running', 'down', or 'disabled')
worker_pidintegerProcess id of the receiver worker
sub_namenameName of the subscription the receiver belongs to
sub_slot_namenameReplication slot name used by the receiver
source_namenameSource node for this receiver (the one it connects to), this is normally the same as the origin node, but is different for forward mode subscriptions
origin_namenameThe origin node for this receiver (the one it receives forwarded changes from), this is normally the same as the source node, but is different for forward mode subscriptions
subscription_modecharMode of the subscription, see bdr.subscription_summary for more details
sub_replication_setstext[]Replication sets this receiver is subscribed to
sub_apply_delayintervalApply delay interval
receive_lsnpg_lsnLSN of the last change received so far
receive_commit_lsnpg_lsnLSN of the last commit received so far
xact_apply_lsnpg_lsnLast applied transaction LSN
xact_flush_lsnpg_lsnLast flushed transaction LSN
xact_apply_timestamptimestamp with time zoneLast applied transaction (commit) timestamp
worker_starttimestamp with time zoneTime at which the receiver started
worker_xact_starttimestamp with time zomeTime at which the receiver started local db transaction (if it is currently processing a local transaction), usually NULL, see xact_start in pg_stat_activity for more details
worker_backend_state_changetimestamp with time zoneBackend state change timestamp, see state_change in pg_stat_activity for more details
worker_backend_statetextCurrent backend state, see state in pg_stat_activity for more details
wait_event_typetextType of wait event the receiver is currently waiting on (if any), see wait_event_type in pg_stat_activity for more details
wait_eventtextExact event the receiver is currently waiting on (if any, see wait_event in pg_stat_activity for more details)

bdr.stat_relation

Shows apply statistics for each relation. Contains data only if tracking is enabled with bdr.track_relation_apply and if data was replicated for a given relation.

lock_acquire_time is updated only if bdr.track_apply_lock_timing is set to on (default: off).

You can reset the stored relation statistics by calling bdr.reset_relation_stats().

bdr.stat_relation columns

ColumnTypeDescription
nspnamenameName of the relation's schema
relnamenameName of the relation
relidoidOID of the relation
total_timedouble precisionTotal time spent processing replication for the relation, in milliseconds
ninsertbigintNumber of inserts replicated for the relation
nupdatebigintNumber of updates replicated for the relation
ndeletebigintNumber of deletes replicated for the relation
ntruncatebigintNumber of truncates replicated for the relation
shared_blks_hitbigintTotal number of shared block cache hits for the relation
shared_blks_readbigintTotal number of shared blocks read for the relation
shared_blks_dirtiedbigintTotal number of shared blocks dirtied for the relation
shared_blks_writtenbigintTotal number of shared blocks written for the relation
blk_read_timedouble precisionTotal time spent reading blocks for the relation, in milliseconds (if track_io_timing is enabled, otherwise zero)
blk_write_timedouble precisionTotal time spent writing blocks for the relation, in milliseconds (if track_io_timing is enabled, otherwise zero)
lock_acquire_timedouble precisionTotal time spent acquiring locks on the relation, in milliseconds (if bdr.track_apply_lock_timing is enabled, otherwise zero)
stats_resettimestamp with time zoneTime of the last statistics reset (performed by bdr.reset_relation_stats())

bdr.stat_routing_candidate_state

A view of information about the routing candidate nodes on the Raft leader (empty on other nodes).

bdr.stat_routing_candidate_state columns

ColumnTypeDescription
node_group_namenameThe group this information is for (each group can have a separate routing proxy)
node_namenameCandidate node name
node_route_fencebooleanThe node is fenced (when true it cannot become leader or read-only connection target)
node_route_readsbooleanThe node is being considered as a read-only connection target
node_route_writesbooleanThe node is being considered as a write lead candidate.
last_message_timetimestamp with time zoneThe time of the last Raft message (any, including requests) seen by this node (used to check liveness of node)

bdr.stat_routing_state

A view of the state of the connection routing which PGD Proxy uses to route the connections.

bdr.stat_routing_state columns

ColumnTypeDescription
node_group_namenameThe group this is information for (each group can have a separate routing proxy)
write_lead_namenameName of the write lead node
previous_write_lead_namenameName of the previous write lead node
read_namesname[]Array of nodes to which read-only connections are routed
write_candidate_namesname[]Nodes that match all criteria needed to become write lead in case of failover
read_candidate_namesname[]Nodes that match all criteria needed to become read-only connection targets in case of failover

bdr.stat_subscription

Shows apply statistics for each subscription. Contains data only if tracking is enabled with bdr.track_subscription_apply.

You can reset the stored subscription statistics by calling bdr.reset_subscription_stats().

bdr.stat_subscription columns

ColumnTypeDescription
sub_namenameName of the subscription
subidoidOID of the subscription
mean_apply_timedouble precisionAverage time per apply transaction, in milliseconds
nconnectbigintNumber of times this subscription has connected upstream
ncommitbigintNumber of commits this subscription did
nabortbigintNumber of aborts writer did for this subscription
nerrorbigintNumber of errors writer has hit for this subscription
nskippedtxbigintNumber of transactions skipped by writer for this subscription (due to skip_transaction conflict resolver)
ninsertbigintNumber of inserts this subscription did
nupdatebigintNumber of updates this subscription did
ndeletebigintNumber of deletes this subscription did
ntruncatebigintNumber of truncates this subscription did
nddlbigintNumber of DDL operations this subscription has executed
ndeadlocksbigintNumber of errors that were caused by deadlocks
nretriesbigintNumber of retries the writer did (without going for full restart/reconnect)
nstream_writerbigintNumber of transactions streamed to writer
nstream_filebigintNumber of transactions streamed to file
nstream_commitbigintNumber of streaming transactions committed
nstream_abortbigintNumber of streaming transactions aborted
nstream_startbigintNumber of STREAM START messages processed
nstream_stopbigintNumber of STREAM STOP messages processed
nstream_commitbigintNumber of streaming transactions committed
nstream_abortbigintNumber of streaming transactions aborted
nstream_preparebigintNumber of streaming transactions prepared
nstream_insertbigintNumber of streaming inserts processed
nstream_updatebigintNumber of streaming updates processed
nstream_deletebigintNumber of streaming deletes processed
nstream_truncatebigintNumber of streaming truncates processed
shared_blks_hitbigintTotal number of shared block cache hits by the subscription
shared_blks_readbigintTotal number of shared blocks read by the subscription
shared_blks_dirtiedbigintTotal number of shared blocks dirtied by the subscription
shared_blks_writtenbigintTotal number of shared blocks written by the subscription
blk_read_timedouble precisionTotal time the subscription spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)
blk_write_timedouble precisionTotal time the subscription spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)
connect_timetimestamp with time zoneTime when the current upstream connection was established, NULL if not connected
last_disconnect_timetimestamp with time zoneTime when the last upstream connection was dropped
start_lsnpg_lsnLSN from which this subscription requested to start replication from the upstream
retries_at_same_lsnbigintNumber of attempts the subscription was restarted from the same LSN value
curr_ncommitbigintNumber of commits this subscription did after the current connection was established
npre_commit_confirmationsbigintNumber of precommit confirmations by CAMO partners
npre_commitbigintNumber of precommits
ncommit_preparedbigintNumber of prepared transaction commits
nabort_preparedbigintNumber of prepared transaction aborts
nprovisional_waitsbigintNumber of update/delete operations on same tuples by concurrent apply transactions. These are provisional waits. See Parallel Apply
ntuple_waitsbigintNumber of update/delete operations that waited to be safely applied. See Parallel Apply
ncommit_waitsbigintNumber of fully applied transactions that had to wait before being committed. See Parallel Apply
stats_resettimestamp with time zoneTime of the last statistics reset (performed by bdr.reset_subscription_stats())

bdr.stat_worker

A view containing summary information and per worker statistics for PGD manager workers.

bdr.stat_worker columns

ColumnTypeDescription
worker_roletextRole of the BDR worker
worker_pidintegerProcess id of the worker
sub_namenameName of the subscription the worker is related to, if any
worker_starttimestamp with time zoneTime at which the worker started
worker_xact_starttimestamp with time zoneTime at which the worker started the local db transaction, see xact_start in pg_stat_activity for more details
worker_xidxidTransaction id of the worker, see backend_xid in pg_stat_activity for more details
worker_xminxidOldest transaction id needed by the worker, see backend_xmin in pg_stat_activity for more details
worker_backend_state_changetimestamp with time zoneBackend state change timestamp see state_change in pg_stat_activity for more details
worker_backend_statetextCurrent backend state see state in pg_stat_activity for more details
wait_event_typetextThe type of wait event the worker is currently waitiing on, if any (see wait_event_type in pg_stat_activity for more details)
wait_eventtextThe exact event the worker is waiting on, if any (see wait_event in pg_stat_activity for more details)
blocked_by_pidsinteger[]List of PIDs blocking the worker, if any
querytextQuery currently being run by the worker
worker_query_starttimestamp with time zoneTimestamp at which the current query run by the worker started

bdr.stat_writer

A view containing summary information and statistics for each subscription replication writer. There can be multiple writers for each subscription.

bdr.stat_writer columns

ColumnTypeDescription
worker_roletextRole of the BDR worker (always 'writer')
worker_statetextState of the worker (can be 'running', 'down', or 'disabled')
worker_pidintegerProcess id of the writer
sub_namenameName of the subscription the writer belongs to
writer_nrintegerWriter index in the writer group for the same subscription
nxactsbigintThe number of transactions the writer has processed since start
ncommitsbigintThe number of commits the writer processed since start
nabortsbigintThe number of aborts the writer processed since start
commit_queue_positionintegerPosition in the commit queue, when serializing transactions against other writers in the same writer group
xact_source_xidxidTransaction id of the currently processed transaction on the source node
xact_source_commit_lsnpg_lsnLSN of the currently processed transaction on the source node
xact_nchangesbigintThe number of changes in the currently processed transaction that have been written (updated every 1000 changes)
xact_origin_node_namenameOrigin node of the currently processed transaction
xact_origin_lsnpg_lsnOrigin LSN of the currently processed transaction
xact_origin_timestamptimestamp with time zoneOrigin commit timestamp of the currently processed transaction
streaming_allowedbooleanThe writer can receive direct stream for large transactions
is_streamingbooleanThe writer is currently receiving a direct stream of a large transaction
nstream_filebigintThe number of stream files the writer has processed
nstream_writerbigintThe number of directly streamed transactions the writer has processed
worker_starttimestamp with time zoneThe time at which the writer started
worker_xact_starttimestamp with time zoneThe time at which the writer start the local db transaction (see xact_start in pg_stat_activity for more details)
worker_xidxidTransaction id of the worker (see backend_xid in pg_stat_activity for more details)
worker_xminxidOldest transaction id needed by the worker (see backend_xmin in pg_stat_activity for more details)
worker_backend_state_changetimestamp with time zoneBackend state change timestamp (see state_change in pg_stat_activity for more details)
worker_backend_statetextCurrent backend state (see state in pg_stat_activity for more details)
wait_event_typetextThe type of wait event the writer is currently waiting on, if any (see event_type in pg_stat_activity for more details)
wait_eventtextThe exact event the writer is waiting on, if any (see wait_event in pg_stat_activity for more details)
blocked_by_pidsinteger[]List of PIDs blocking the writer, if any
querytextQuery currently being run by the writer (normally only set for DDL)
worker_query_starttimestamp with time zoneTimestamp at which the current query run by the worker started
command_progress_cmdtagtextFor commands with progress tracking, identifies the command current processed by the writer (can be one of 'CREATE INDEX', 'CREATE INDEX CONCURRENTLY', 'REINDEX', 'REINDEX CONCURRENTLY', 'CLUSTER', and 'VACUUM FULL')
command_progress_relationtextFor commands with progress tracking, identifies therelation which the command is working on
command_progress_phasetextFor commands with progress tracking, name of the current phase the command is in, refer to Progress Reporting in the Postgres documentation for details
command_progress_countintegerFor commands with progress tracking, the number of phases this command has gone through
command_progress_phase_nrintegerFor commands with progress tracking, the number of the phase of command_progress_count
command_progress_phase_tuples_totalrealFor commands with progress tracking, the number of rows the current phase of the command has to process (if the phase is process rows)
command_progress_tuples_donebigintFor commands with progress tracking, the number of rows the current phase of the command has already processed (if the phase is process rows)

bdr.subscription

This catalog table lists all the subscriptions owned by the local PGD node and their modes.

bdr.subscription columns

NameTypeDescription
sub_idoidID of the subscription
sub_namenameName of the subscription
nodegroup_idoidID of nodegroup
origin_node_idoidID of origin node
source_node_idoidID of source node
target_node_idoidID of target node
subscription_modecharMode of subscription
sub_enabledboolWhether the subscription is enabled (should be replication)
apply_delayintervalHow much behind should the apply of changes on this subscription be (normally 0)
slot_namenameSlot on upstream used by this subscription
origin_namenameLocal origin used by this subscription
num_writersintNumber of writer processes this subscription uses
streaming_modecharStreaming configuration for the subscription
replication_setstext[]Replication sets replicated by this subscription (NULL = all)
forward_origintext[]Origins forwarded by this subscription (NULL = all)

bdr.subscription_summary

This view contains summary information about all PGD subscriptions that the local node has to other nodes.

bdr.subscription_summary columns

NameTypeDescription
node_group_namenameName of the PGD group the node is part of
sub_namenameName of the subscription
origin_namenameName of the origin node
target_namenameName of the target node (normally local node)
sub_enabledboolIs the subscription enabled
sub_slot_namenameSlot name on the origin node used by this subscription
sub_replication_setstext[]Replication sets subscribed
sub_forward_originstext[]Does the subscription accept changes forwarded from other nodes besides the origin
sub_apply_delayintervalDelay transactions by this much compared to the origin
sub_origin_namenameReplication origin name used by this subscription
bdr_subscription_modecharSubscription mode
subscription_statustextStatus of the subscription worker
node_group_idoidOID of the PGD group the node is part of
sub_idoidOID of the subscription
origin_idoidOID of the origin node
target_idoidOID of the target node
receive_lsnpg_lsnLatest LSN of any change or message received (this can go backwards in case of restarts)
receive_commit_lsnpg_lsnLatest LSN of last COMMIT received (this can go backwards in case of restarts)
last_xact_replay_lsnpg_lsnLSN of last transaction replayed on this subscription
last_xact_flush_lsntimestamptzLSN of last transaction replayed on this subscription that's flushed durably to disk
last_xact_replay_timestamptimestamptzTimestamp of last transaction replayed on this subscription

bdr.tables

This view lists information about table membership in replication sets. If a table exists in multiple replication sets, it appears multiple times in this table.

bdr.tables columns

NameTypeDescription
relidoidOID of the relation
nspnamenameName of the schema relation is in
relnamenameName of the relation
set_namenameName of the replication set
set_opstext[]List of replicated operations
rel_columnstext[]List of replicated columns (NULL = all columns) (*)
row_filtertextRow filtering expression
conflict_detectiontextConflict detection method used: row_origin (default), row_version or column_level

(*) These columns are reserved for future use and should currently be NULL

bdr.taskmgr_work_queue

Contains work items created and processed by task manager. The work items are created on only one node and processed on different nodes.

bdr.taskmgr_work_queue columns

ColumnTypeDescription
ap_wq_workidbigintUnique ID of the work item
ap_wq_ruleidintID of the rule listed in autopartition_rules. Rules are specified using bdr.autopartition command
ap_wq_relnamenameName of the relation the task belongs to
ap_wq_relnamespacenameName of the tablespace specified in rule for this work item
ap_wq_partnamenameName of the partition created by the workitem
ap_wq_work_categorycharWork category; can be c (create partition), m (migrate partition), d (drop partition), or a (alter partition)
ap_wq_work_sqltextSQL query for the work item
ap_wq_work_dependsOid[]OIDs of the nodes on which the work item depends

bdr.taskmgr_workitem_status

The status of the work items that is updated locally on each node.

bdr.taskmgr_workitem_status columns

ColumnTypeDescription
ap_wi_workidbigintID of the work item
ap_wi_nodeidOidOID of the node on which the work item is being processed
ap_wi_statuscharStatus; can be q (queued), c (complete), f (failed), or u (unknown)
ap_wi_started_attimestamptzStart timestamptz of work item
ap_wi_finished_attimestamptzEnd timestamptz of work item

bdr.taskmgr_local_work_queue

Contains work items created and processed by the task manager. This is similar to bdr.taskmgr_work_queue, except that these work items are for locally managed tables. Each node creates and processes its own local work items, independent of other nodes in the cluster.

bdr.taskmgr_local_work_queue columns

ColumnTypeDescription
ap_wq_workidbigintUnique ID of the work item
ap_wq_ruleidintID of the rule listed in autopartition_rules. Rules are specified using bdr.autopartition command
ap_wq_relnamenameName of the relation the task belongs to
ap_wq_relnamespacenameName of the tablespace specified in rule for this work item.
ap_wq_partnamenameName of the partition created by the workitem
ap_wq_work_categorycharCategory; can be c (create partition), m (migrate partition), d (drop partition), or a (alter partition)
ap_wq_work_sqltextSQL query for the work item
ap_wq_work_dependsOid[]Always NULL

bdr.taskmgr_local_workitem_status

The status of the work items for locally managed tables.

bdr.taskmgr_local_workitem_status columns

ColumnTypeDescription
ap_wi_workidbigintID of the work item
ap_wi_nodeidOidOID of the node on which the work item is being processed
ap_wi_statuscharStatus; can be q (queued), c (complete), f (failed), or u (unknown)
ap_wi_started_attimestamptzStart timestamptz of work item
ap_wi_finished_attimestamptzEnd timestamptz of work item

bdr.trigger

In this view, you can see all the stream triggers created. Often triggers here are created from bdr.create_conflict_trigger.

bdr.trigger columns

NameTypeDescription
trigger_idoidID of the trigger
trigger_reloidregclassName of the relating function
trigger_pgtgidoidPostgres trigger ID
trigger_typecharType of trigger call
trigger_namenameName of the trigger

bdr.triggers

An expanded view of bdr.trigger with columns that are easier to read.

NameTypeDescription
trigger_namenameName of the trigger
event_manipulationtextOperations
trigger_typebdr.trigger_typeType of trigger
trigger_tablebdr.trigger_reloidTable that calls the trigger
trigger_functionnameFunction used

bdr.workers

Information about running PGD worker processes.

This can be joined with bdr.stat_activity using pid to get even more insight into the state of PGD workers.

bdr.workers Columns

NameTypeDescription
worker_pidintProcess ID of the worker process
worker_roleintNumeric representation of worker role
worker_role_nametextName of the worker role
worker_subidoidSubscription ID if the worker is associated with one

bdr.writers

Specific information about PGD writer processes.

bdr.writers columns

NameTypeDescription
sub_namenameName of the subscription
pidintProcess ID of the worker process
syncing_relintOID of the relation being synchronized (if any)
streaming_allowedtextCan this writer be target of direct to writer streaming
is_streamingboolIs there transaction being streamed to this writer
remote_xidxidRemote transaction id of the transaction being processed (if any)
remote_commit_lsnpg_lsnLSN of last commit processed
commit_queue_positionintPosition in the internal commit queue
nxactsbigintNumber of transactions processed by this writer
ncommitsbigintNumber of transactions committed by this writer
nabortsbigintNumber of transactions aborted by this writer
nstream_filebigintNumber of streamed-to-file transactions processed by this writer
nstream_writerbigintNumber of streamed-to-writer transactions processed by this writer
xact_nchangesbigintNumber of changes processed by this writer (updated every 1000 rows)

bdr.worker_tasks

The bdr.worker_tasks view shows PGD's current worker launch rate limiting state as well as some basic statistics on background worker launch and registration activity.

Unlike the other views listed here, it isn't specific to the current database and PGD node. State for all PGD nodes on the current PostgreSQL instance is shown. Join on the current database to filter it.

bdr.worker_tasks doesn't track walsenders and output plugins.

bdr.worker_tasks columns

ColumnTypeDescription
task_key_worker_roleintegerWorker role identifier
task_key_worker_role_nametextWorker role name
task_key_dboidoidDatabase identifier, if available
datnamenameName of the database, if available
task_key_subidoidSubscription identifier, if available
sub_namenameName of the subscription, if available
task_key_ext_libnamenameName of the library (most likely bdr)
task_key_ext_funcnamenameName of the function entry point
task_key_ext_workernamenameName assigned to the worker
task_key_remoterelidoidIdentifier of the remote syncing relation, if available
task_pidintegerProcess ID of the worker
task_registeredtimestamp with time zoneWorker registration timestamp
since_registeredintervalInterval since the worker registered
task_attachedtimestamp with time zoneWorker attach timestamp
since_attachedintervalInterval since the worker attached
task_exitedtimestamp with time zoneWorker exit timestamp
since_exitedintervalInterval since the worker exited
task_successbooleanIs worker still running?
task_next_launch_not_beforetimestamp with time zoneTimestamp when the worker will be restarted again
until_launch_allowedintervalTime remaining for next launch
task_last_launch_requestor_pidintegerProcess ID that requested launch
task_last_launch_request_timetimestamp with time zoneTimestamp when the request was made
since_last_requestintervalInterval since the last request
task_last_launch_request_approvedbooleanDid the last request succeed?
task_nrequestsintegerNumber of requests
task_nregistrationsintegerNumber of registrations
task_prev_pidintegerProcess ID of the previous generation
task_prev_registeredtimestamp with time zoneTimestamp of the previous registered task
since_prev_registeredintervalInterval since the previous registration
task_prev_launchedtimestamp with time zoneTimestamp of the previous launch
since_prev_launchedintervalInterval since the previous launch
task_prev_exitedtimestamp with time zoneTimestamp when the previous task exited
since_prev_exitedintervalInterval since the previous task exited
task_first_registeredtimestamp with time zoneTimestamp when the first registration happened
since_first_registeredintervalInterval since the first registration