Catalogs and Views v3.7
This section contains a listing of system catalogs and views used by BDR in alphabetical order.
User-Visible Catalogs and Views
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 may see all conflicts for the tables they own, restricted by row-level security.
For further details see Logging Conflicts to a Table.
bdr.conflict_history
Columns
Name | Type | Description |
---|---|---|
sub_id | oid | which subscription produced this conflict; can be joined to bdr.subscription table |
local_xid | xid | local transaction of the replication process at the time of conflict |
local_lsn | pg_lsn | local transaction of the replication process at the time of conflict |
local_time | timestamp with time zone | local time of the conflict |
remote_xid | xid | transaction which produced the conflicting change on the remote node (an origin) |
remote_commit_lsn | pg_lsn | commit lsn of the transaction which produced the conflicting change on the remote node (an origin) |
remote_commit_time | timestamp with time zone | commit timestamp of the transaction which produced the conflicting change on the remote node (an origin) |
conflict_type | text | detected type of the conflict (see [List of Conflict Types]) |
conflict_resolution | text | conflict resolution chosen (see [List of Conflict Resolutions]) |
conflict_index | regclass | conflicting index (only valid if the index wasn't dropped since) |
reloid | oid | conflicting relation (only valid if the index wasn't dropped since) |
nspname | text | name of the schema for the relation on which the conflict has occurred at the time of conflict (does not follow renames) |
relname | text | name of the relation on which the conflict has occurred at the time of conflict (does not follow renames) |
key_tuple | json | json representation of the key used for matching the row |
remote_tuple | json | json representation of an incoming conflicting row |
local_tuple | json | json representation of the local conflicting row |
apply_tuple | json | json representation of the resulting (the one that has been applied) row |
local_tuple_xmin | xid | transaction which produced the local conflicting row (if local_tuple is set and the row is not frozen) |
local_tuple_node_id | oid | node which produced the local conflicting row (if local_tuple is set and the row is not frozen) |
local_tuple_commit_time | timestamp with time zone | last known change timestamp of the local conflicting row (if local_tuple is set and the row is not frozen) |
bdr.conflict_history_summary
A view containing user-readable details on row conflict.
bdr.conflict_history_summary
Columns
Name | Type | Description |
---|---|---|
schema | text | Name of the schema |
table | text | Name of the table |
local_time | timestamp with time zone | local time of the conflict |
local_tuple_commit_time | timestamp with time zone | Time of local commit |
remote_commit_time | timestamp with time zone | Time of remote commit |
conflict_type | text | Type of conflict |
conflict_resolution | text | Resolution 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
Name | Type | Description |
---|---|---|
kv_key | text | Unique key |
kv_val | json | Arbitrary value in json format |
kv_create_ts | timestamptz | Last write timestamp |
kv_ttl | int | Time to live for the value in milliseconds |
kv_expire_ts | timestamptz | Expiration timestamp (kv_create_ts + kv_ttl ) |
bdr.camo_decision_journal
A persistent journal of decisions resolved by a CAMO partner node
after a failover, in case bdr.logical_transaction_status
got
invoked. Unlike bdr.node_pre_commit
, this does not cover
transactions processed under normal operational conditions (i.e. both
nodes of a CAMO pair are running and connected). Entries in this journal
are not ever cleaned up automatically. This is a purely diagnostic
tool that the system does not depend on in any way.
bdr.camo_decision_journal
Columns
Name | Type | Description |
---|---|---|
origin_node_id | oid | OID of the node where the transaction executed |
origin_xid | oid | Transaction Id on the remote origin node |
decision | char | 'c' for commit, 'a' for abort |
decision_ts | timestamptz | Decision time |
Note
This catalog is only present when bdr-enterprise extension is installed.
bdr.crdt_handlers
This table lists merge ("handlers") functions for all CRDT data types.
bdr.crdt_handlers
Columns
Name | Type | Description |
---|---|---|
crdt_type_id | regtype | CRDT data type id |
crdt_merge_id | regproc | Merge function for this data type |
Note
This catalog is only present when bdr-enterprise extension is installed.
bdr.ddl_replication
This view lists DDL replication configuration as set up by current DDL filters.
bdr.ddl_replication
Columns
Name | Type | Description |
---|---|---|
set_ddl_name | name | Name of DDL filter |
set_ddl_tag | text | Which command tags it applies on (regular expression) |
set_ddl_role | text | Which roles it applies to (regular expression) |
set_name | name | Name of the replication set for which this filter is defined |
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
Name | Type | Description |
---|---|---|
log_index | int8 | Id of the journal entry |
term | int8 | Raft term |
origin | oid | Id of node where the request originated |
req_id | int8 | Id for the request |
req_payload | bytea | Payload for the request |
trace_context | bytea | Trace 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
Name | Type | Description |
---|---|---|
log_index | int8 | Id of the journal entry |
term | int8 | Raft term |
request_id | int8 | Id of the request |
origin_id | oid | Id of the node where the request originated |
req_payload | bytea | Payload of the request |
origin_node_name | name | Name of the node where the request originated |
message_type_no | oid | Id of the BDR message type for the request |
message_type | text | Name of the BDR message type for the request |
message_payload | text | BDR message payload for the request |
response_message_type_no | oid | Id of the BDR message type for the response |
response_message_type | text | Name of the BDR message type for the response |
response_payload | text | BDR message payload for the response |
response_errcode_no | text | SQLSTATE for the response |
response_errcode | text | Error code for the response |
response_message | text | Error 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
Name | Type | Description |
---|---|---|
log_index | int8 | Id of the journal entry |
res_status | oid | Status code for the response |
res_payload | bytea | Payload for the response |
trace_context | bytea | Trace 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, operators should prefer the
bdr.global_locks
view, because the visible rows
in bdr.global_lock
do not necessarily reflect all global locking activity.
Do not modify the contents of this table: it is an important BDR catalog.
bdr.global_lock
Columns
Name | Type | Description |
---|---|---|
ddl_epoch | int8 | DDL epoch for the lock |
origin_node_id | oid | OID of the node where the global lock has originated |
lock_type | oid | Type of the lock (DDL or DML) |
nspname | name | Schema name for the locked relation |
relname | name | Relation name for the locked relation |
groupid | oid | OID of the top level group (for Advisory locks) |
key1 | integer | First 32-bit key or lower order 32-bits of 64-bit key (for Advisory locks) |
key2 | integer | Second 32-bit key or higher order 32-bits of 64-bit key (for Advisory locks) |
key_is_bigint | boolean | True 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 BDR's shared-memory lock state tracking, giving administrators a greater
insight into BDR's global locking activity and progress.
See Monitoring Global Locks for more information about global locking.
bdr.global_locks
Columns
Name | Type | Description |
---|---|---|
origin_node_id | oid | The OID of the node where the global lock has originated |
origin_node_name | name | Name of the node where the global lock has originated |
lock_type | text | Type of the lock (DDL or DML) |
relation | text | Locked relation name (for DML locks) or keys (for advisory locks) |
pid | int4 | PID of the process holding the lock |
acquire_stage | text | Internal state of the lock acquisition process |
waiters | int4 | List of backends waiting for the same global lock |
global_lock_request_time | timestamptz | Time this global lock acquire was initiated by origin node |
local_lock_request_time | timestamptz | Time the local node started trying to acquire the local-lock |
last_state_change_time | timestamptz | Time 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
andorigin_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, i.e. 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. May be null if unknown on the current node. This time is stamped at the very 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 does NOT include any time taken on DDL epochs or queue flushing. If the lock is re-acquired after local node restart, this will be the node restart time.last_state_change_time
: The timestamp at which thebdr.global_locks.acquire_stage
field last changed for this global lock entry.
bdr.local_consensus_snapshot
This catalog table contains consensus snapshots created or received by the local node.
bdr.local_consensus_snapshot
Columns
Name | Type | Description |
---|---|---|
log_index | int8 | Id of the journal entry |
log_term | int8 | Raft term |
snapshot | bytea | Raft snapshot data |
bdr.local_consensus_state
This catalog table stores the current state of Raft on the local node.
bdr.local_consensus_state
Columns
Name | Type | Description |
---|---|---|
node_id | oid | Id of the node |
current_term | int8 | Raft term |
apply_index | int8 | Raft apply index |
voted_for | oid | Vote cast by this node in this term |
last_known_leader | oid | node_id of last known Raft leader |
bdr.local_node_summary
A view containing the same information as [bdr.node_summary
] but only for the
local node.
bdr.network_path_info
A catalog view that stores user-defined information on network costs between node locations.
bdr.network_path_info
Columns
Name | Type | Description |
---|---|---|
node_group_name | name | Name of the BDR group |
node_region1 | text | Node region name, from bdr.node_location |
node_region2 | text | Node region name, from bdr.node_location |
node_location1 | text | Node location name, from bdr.node_location |
node_location2 | text | Node location name, from bdr.node_location |
network_cost | numeric | Node location name, from bdr.node_location |
bdr.node
This table lists all the BDR nodes in the cluster.
bdr.node
Columns
Name | Type | Description |
---|---|---|
node_id | oid | Id of the node |
node_group_id | oid | Id of the node group |
source_node_id | oid | Id of the source node |
node_state | oid | Consistent state of the node |
target_state | oid | State that the node is trying to reach (during join or promotion) |
seq_id | int4 | Sequence identifier of the node used for generating unique sequence numbers |
dbname | name | Database name of the node |
proto_version_ranges | int[] | Supported protocol version ranges by the node |
reserved | int2 | Reserved field for compatibility purposes |
synchronize_structure | "char" | Schema synchronization done during the join |
bdr.node_catchup_info
This catalog table records relevant catch-up information on each node, either if it is related to the join or part procedure.
bdr.node_catchup_info
Columns
Name | Type | Description |
---|---|---|
node_id | oid | Id of the node |
node_source_id | oid | Id of the node used as source for the data |
slot_name | name | Slot used for this source |
min_node_lsn | pg_lsn | Minimum LSN at which the node can switch to direct replay from a peer node |
catchup_state | oid | Status code of the catchup state |
origin_node_id | oid | Id 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) via forwarding. The records in this table will persist until the node(node_id) is a member of the EDB Postgres Distributed cluster.
bdr.node_conflict_resolvers
Currently configured conflict resolution for all known conflict types.
bdr.node_conflict_resolvers
Columns
Name | Type | Description |
---|---|---|
conflict_type | text | Type of the conflict |
conflict_resolver | text | Resolver used for this conflict type |
bdr.node_group
This catalog table lists all the BDR node groups.
bdr.node_group
Columns
Name | Type | Description |
---|---|---|
node_group_id | oid | ID of the node group |
node_group_name | name | Name of the node group |
node_group_default_repset | oid | Default replication set for this node group |
node_group_default_repset_ext | oid | Default replication set for this node group |
node_group_parent_id | oid | ID of parent group (0 if this is a root group) |
node_group_flags | int | The group flags |
node_group_uuid | uuid | The uuid of the group |
node_group_apply_delay | interval | How long a subscriber waits before applying changes from the provider |
node_group_check_constraints | bool | Whether the apply process should check constraints when applying data |
node_group_num_writers | int | Number of writers to use for subscriptions backing this node group |
node_group_enable_wal_decoder | bool | Whether the group has enable_wal_decoder set |
bdr.node_group_replication_sets
A view showing default replication sets create for BDR groups. See also
bdr.replication_sets
.
bdr.node_group_replication_sets
Columns
Name | Type | Description |
---|---|---|
node_group_name | name | Name of the BDR group |
def_repset | name | Name of the default repset |
def_repset_ops | text[] | Actions replicated by the default repset |
def_repset_ext | name | Name of the default "external" repset (usually same as def_repset) |
def_repset_ext_ops | text[] | Actions replicated by the default "external" repset (usually same as def_repset_ops) |
bdr.node_local_info
A catalog table used to store per-node information that changes less frequently than peer progress.
bdr.node_local_info
Columns
Name | Type | Description |
---|---|---|
node_id | oid | The OID of the node (including the local node) |
applied_state | oid | Internal id of the node state |
ddl_epoch | int8 | Last epoch number processed by the node |
pub_repsets | text[] | List of replication sets publised by the node (only for the local node) |
slot_name | name | Name of the slot used to connect to that node (NULL for the local node) |
sub_repsets | text[] | List of replication sets subscribed by the node (only for the local node) |
bdr.node_location
A catalog view that stores user-defined information on node locations.
bdr.node_location
Columns
Name | Type | Description |
---|---|---|
node_group_name | name | Name of the BDR group |
node_id | oid | Id of the node |
node_region | text | User supplied region name |
node_location | text | User supplied location name |
bdr.node_log_config
A catalog view that stores information on the conflict logging configurations.
bdr.node_log_config
Columns
Name | Description |
---|---|
log_name | name of the logging configuration |
log_to_file | whether it logs to the server log file |
log_to_table | whether it logs to a table, and which table is the target |
log_conflict_type | which conflict types it logs, if NULL means all |
log_conflict_res | which 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 - i.e 1 minute). Expect N * (N-1) rows in this relation.
You may be more interested in the bdr.node_slots
view for monitoring
purposes. See also Monitoring.
bdr.node_peer_progress
Columns
Name | Type | Description |
---|---|---|
node_id | oid | The OID of the originating node which reported this position info |
peer_node_id | oid | The OID of the node's peer (remote node) for which this position info was reported |
last_update_sent_time | timestamptz | The time at which the report was sent by the originating node |
last_update_recv_time | timestamptz | The time at which the report was received by the local server |
last_update_node_lsn | pg_lsn | LSN on the originating node at the time of the report |
peer_position | pg_lsn | Latest LSN of the node's peer seen by the originating node |
peer_replay_time | timestamptz | Latest replay time of peer seen by the reporting node |
last_update_horizon_xid | oid | Internal resolution horizon: all lower xids are known resolved on the reporting node |
last_update_horizon_lsn | pg_lsn | Internal resolution horizon: same in terms of an LSN of the reporting node |
bdr.node_pre_commit
Used internally on a node configured as a Commit At Most Once (CAMO) partner. Shows the decisions a CAMO partner took on transactions in the last 15 minutes.
bdr.node_pre_commit
Columns
Name | Type | Description |
---|---|---|
origin_node_id | oid | OID of the node where the transaction executed |
origin_xid | oid | Transaction Id on the remote origin node |
decision | char | 'c' for commit, 'a' for abort |
local_xid | xid | Transaction Id on the local node |
commit_ts | timestamptz | commit timestamp of the transaction |
decision_ts | timestamptz | decision time |
Note
This catalog is only present when bdr-enterprise extension is installed.
bdr.node_replication_rates
This view contains information about outgoing replication activity from a given node
bdr.node_replication_rates
Columns
Column | Type | Description |
---|---|---|
peer_node_id | oid | The OID of node's peer (remote node) for which this info was reported |
target_name | name | Name of the target peer node |
sent_lsn | pg_lsn | Latest sent position |
replay_lsn | pg_lsn | Latest position reported as replayed (visible) |
replay_lag | interval | Approximate lag time for reported replay |
replay_lag_bytes | int8 | Bytes difference between replay_lsn and current WAL write position on origin |
replay_lag_size | text | Human-readable bytes difference between replay_lsn and current WAL write position |
apply_rate | bigint | LSNs being applied per second at the peer node |
catchup_interval | interval | Approximate time required for the peer node to catchup to all the changes that are yet to be applied |
Note
The replay_lag
is set immediately to zero after reconnect; we suggest
as a workaround to use replay_lag_bytes
, replay_lag_size
or
catchup_interval
.
Note
This catalog is only present when bdr-enterprise extension is installed.
bdr.node_slots
This view contains information about replication slots used in the current database by BDR.
See Monitoring Outgoing Replication for guidance on the use and interpretation of this view's fields.
bdr.node_slots
Columns
Name | Type | Description |
---|---|---|
target_dbname | name | Database name on the target node |
node_group_name | name | Name of the BDR group |
node_group_id | oid | The OID of the BDR group |
origin_name | name | Name of the origin node |
target_name | name | Name of the target node |
origin_id | oid | The OID of the origin node |
target_id | oid | The OID of the target node |
local_slot_name | name | Name of the replication slot according to BDR |
slot_name | name | Name of the slot according to Postgres (should be same as above) |
is_group_slot | boolean | True if the slot is the node-group crash recovery slot for this node (see ["Group Replication Slot"](nodes.md#Group Replication Slot)) |
plugin | name | Logical decoding plugin using this slot (should be pglogical_output) |
slot_type | text | Type of the slot (should be logical) |
datoid | oid | The OID of the current database |
database | name | Name of the current database |
temporary | bool | Is the slot temporary |
active | bool | Is the slot active (does it have a connection attached to it) |
active_pid | int4 | The PID of the process attached to the slot |
xmin | xid | The XID needed by the slot |
catalog_xmin | xid | The catalog XID needed by the slot |
restart_lsn | pg_lsn | LSN at which the slot can restart decoding |
confirmed_flush_lsn | pg_lsn | Latest confirmed replicated position |
usesysid | oid | sysid of the user the replication session is running as |
usename | name | username of the user the replication session is running as |
application_name | text | Application name of the client connection (used by synchronous_standby_names ) |
client_addr | inet | IP address of the client connection |
client_hostname | text | Hostname of the client connection |
client_port | int4 | Port of the client connection |
backend_start | timestamptz | When the connection started |
state | text | State of the replication (catchup, streaming, ...) or 'disconnected' if offline |
sent_lsn | pg_lsn | Latest sent position |
write_lsn | pg_lsn | Latest position reported as written |
flush_lsn | pg_lsn | Latest position reported as flushed to disk |
replay_lsn | pg_lsn | Latest position reported as replayed (visible) |
write_lag | interval | Approximate lag time for reported write |
flush_lag | interval | Approximate lag time for reported flush |
replay_lag | interval | Approximate lag time for reported replay |
sent_lag_bytes | int8 | Bytes difference between sent_lsn and current WAL write position |
write_lag_bytes | int8 | Bytes difference between write_lsn and current WAL write position |
flush_lag_bytes | int8 | Bytes difference between flush_lsn and current WAL write position |
replay_lag_bytes | int8 | Bytes difference between replay_lsn and current WAL write position |
sent_lag_size | text | Human-readable bytes difference between sent_lsn and current WAL write position |
write_lag_size | text | Human-readable bytes difference between write_lsn and current WAL write position |
flush_lag_size | text | Human-readable bytes difference between flush_lsn and current WAL write position |
replay_lag_size | text | Human-readable bytes difference between replay_lsn and current WAL write position |
Note
The replay_lag
is set immediately to zero after reconnect; we suggest
as a workaround to use replay_lag_bytes
or replay_lag_size
.
bdr.node_summary
This view contains summary information about all BDR nodes known to the local node.
bdr.node_summary
Columns
Name | Type | Description |
---|---|---|
node_name | name | Name of the node |
node_group_name | name | Name of the BDR group the node is part of |
interface_name | name | Name of the connection interface used by the node |
interface_connstr | text | Connection string to the node |
peer_state_name | text | Consistent state of the node in human readable form |
peer_target_state_name | text | State which the node is trying to reach (during join or promotion) |
node_seq_id | int4 | Sequence identifier of the node used for generating unique sequence numbers |
node_local_dbname | name | Database name of the node |
pub_repsets | text[] | Deprecated column, always NULL, will be removed in 4.0 |
sub_repsets | text[] | Deprecated column, always NULL, will be removed in 4.0 |
set_repl_ops | text | Which operations does the default replication set replicate |
node_id | oid | The OID of the node |
node_group_id | oid | The OID of the BDR node group |
if_id | oid | The OID of the connection interface used by the node |
bdr.replication_sets
A view showing replication sets defined in the BDR group, even if they are not currently used by any node.
bdr.replication_sets
Columns
Name | Type | Description |
---|---|---|
set_id | oid | The OID of the replication set |
set_name | name | Name of the replication set |
replicate_insert | boolean | Indicates if the replication set replicates INSERTs |
replicate_update | boolean | Indicates if the replication set replicates UPDATEs |
replicate_delete | boolean | Indicates if the replication set replicates DELETEs |
replicate_truncate | boolean | Indicates if the replication set replicates TRUNCATEs |
set_autoadd_tables | boolean | Indicates if new tables will be automatically added to this replication set |
set_autoadd_seqs | boolean | Indicates if new sequences will be automatically added to this replication set |
bdr.schema_changes
A simple view to show all the changes to schemas within BDR.
bdr.schema_changes
Columns
Name | Type | Description |
---|---|---|
schema_changes_ts | timestampstz | The ID of the trigger |
schema_changes_change | char | A flag of change type |
schema_changes_classid | oid | Class ID |
schema_changes_objectid | oid | Object ID |
schema_changes_subid | smallint | The subscription |
schema_changes_descr | text | The object changed |
schema_changes_addrnames | text[] | Location of schema change |
bdr.sequence_alloc
A view to see the allocation details for galloc sequences.
bdr.sequence_alloc
Columns
Name | Type | Description |
---|---|---|
seqid | regclass | The ID of the sequence |
seq_chunk_size | bigint | A sequence number for the chunk within its value |
seq_allocated_up_to | bigint | |
seq_nallocs | bigint | |
seq_last_alloc | timestamptz | Last sequence allocated |
bdr.schema_changes
A simple view to show all the changes to schemas within BDR.
bdr.schema_changes
Columns
Name | Type | Description |
---|---|---|
schema_changes_ts | timestampstz | The ID of the trigger |
schema_changes_change | char | A flag of change type |
schema_changes_classid | oid | Class ID |
schema_changes_objectid | oid | Object ID |
schema_changes_subid | smallint | The subscription |
schema_changes_descr | text | The object changed |
schema_changes_addrnames | text[] | Location of schema change |
bdr.sequence_alloc
A view to see the sequences allocated.
bdr.sequence_alloc
Columns
Name | Type | Description |
---|---|---|
seqid | regclass | The ID of the sequence |
seq_chunk_size | bigint | A sequence number for the chunk within its value |
seq_allocated_up_to | bigint | |
seq_nallocs | bigint | |
seq_last_alloc | timestamptz | Last sequence allocated |
bdr.sequences
This view lists all sequences with their kind, excluding sequences for internal BDR book-keeping.
bdr.sequences
Columns
Name | Type | Description |
---|---|---|
nspname | name | Namespace containing the sequence |
relname | name | Name of the sequence |
seqkind | text | Type 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 BDR.
bdr.stat_relation
Apply statistics for each relation. Only contains data if the tracking is enabled and something was replicated for a given relation.
bdr.stat_relation
Columns
Column | Type | Description |
---|---|---|
nspname | name | Name of the relation's schema |
relname | name | Name of the relation |
relid | oid | Oid of the relation |
total_time | double precision | Total time spent processing replication for the relation |
ninsert | bigint | Number of inserts replicated for the relation |
nupdate | bigint | Number of updates replicated for the relation |
ndelete | bigint | Number of deletes replicated for the relation |
ntruncate | bigint | Number of truncates replicated for the relation |
shared_blks_hit | bigint | Total number of shared block cache hits for the relation |
shared_blks_read | bigint | Total number of shared blocks read for the relation |
shared_blks_dirtied | bigint | Total number of shared blocks dirtied for the relation |
shared_blks_written | bigint | Total number of shared blocks written for the relation |
blk_read_time | double precision | Total time spent reading blocks for the relation, in milliseconds (if track_io_timing is enabled, otherwise zero) |
blk_write_time | double precision | Total time spent writing blocks for the relation, in milliseconds (if track_io_timing is enabled, otherwise zero) |
lock_acquire_time | double precision | Total time spent acquiring locks on the relation, in milliseconds (if pglogical.track_apply_lock_timing is enabled, otherwise zero) |
bdr.stat_subscription
Apply statistics for each subscription. Only contains data if the tracking is enabled.
bdr.stat_subscription
Columns
Column | Type | Description |
---|---|---|
sub_name | name | Name of the subscription |
subid | oid | Oid of the subscription |
nconnect | bigint | Number of times this subscription has connected upstream |
ncommit | bigint | Number of commits this subscription did |
nabort | bigint | Number of aborts writer did for this subscription |
nerror | bigint | Number of errors writer has hit for this subscription |
nskippedtx | bigint | Number of transactions skipped by writer for this subscription (due to skip_transaction conflict resolver) |
ninsert | bigint | Number of inserts this subscription did |
nupdate | bigint | Number of updates this subscription did |
ndelete | bigint | Number of deletes this subscription did |
ntruncate | bigint | Number of truncates this subscription did |
nddl | bigint | Number of DDL operations this subscription has executed |
ndeadlocks | bigint | Number of errors that were caused by deadlocks |
nretries | bigint | Number of retries the writer did (without going for full restart/reconnect) |
shared_blks_hit | bigint | Total number of shared block cache hits by the subscription |
shared_blks_read | bigint | Total number of shared blocks read by the subscription |
shared_blks_dirtied | bigint | Total number of shared blocks dirtied by the subscription |
shared_blks_written | bigint | Total number of shared blocks written by the subscription |
blk_read_time | double precision | Total time the subscription spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero) |
blk_write_time | double precision | Total time the subscription spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero) |
connect_time | timestamp with time zone | Time when the current upstream connection was established, NULL if not connected |
last_disconnect_time | timestamp with time zone | Time when the last upstream connection was dropped |
start_lsn | pg_lsn | LSN from which this subscription requested to start replication from the upstream |
retries_at_same_lsn | bigint | Number of attempts the subscription was restarted from the same LSN value |
curr_ncommit | bigint | Number of commits this subscription did after the current connection was established |
bdr.subscription
This catalog table lists all the subscriptions owned by the local BDR node, and which mode they are in.
bdr.subscription
Columns
Name | Type | Description |
---|---|---|
pgl_subscription_id | oid | Subscription in pglogical |
nodegroup_id | oid | Id of nodegroup |
origin_node_id | oid | Id of origin node |
target_node_id | oid | Id of target node |
subscription_mode | char | Mode of subscription |
source_node_id | oid | Id of source node |
ddl_epoch | int8 | DDL epoch |
bdr.subscription_summary
This view contains summary information about all BDR subscriptions that the local node has to other nodes.
bdr.subscription_summary
Columns
Name | Type | Description |
---|---|---|
node_group_name | name | Name of the BDR group the node is part of |
sub_name | name | Name of the subscription |
origin_name | name | Name of the origin node |
target_name | name | Name of the target node (normally local node) |
sub_enabled | bool | Is the subscription enabled |
sub_slot_name | name | Slot name on the origin node used by this subscription |
sub_replication_sets | text[] | Replication sets subscribed |
sub_forward_origins | text[] | Does the subscription accept changes forwarded from other nodes besides the origin |
sub_apply_delay | interval | Delay transactions by this much compared to the origin |
sub_origin_name | name | Replication origin name used by this subscription |
bdr_subscription_mode | char | Subscription mode |
subscription_status | text | Status of the subscription worker |
node_group_id | oid | The OID of the BDR group the node is part of |
sub_id | oid | The OID of the subscription |
origin_id | oid | The OID of the origin node |
target_id | oid | The OID of the target node |
receive_lsn | pg_lsn | Latest LSN of any change or message received (this can go backwards in case of restarts) |
receive_commit_lsn | pg_lsn | Latest LSN of last COMMIT received (this can go backwards in case of restarts) |
last_xact_replay_lsn | pg_lsn | LSN of last transaction replayed on this subscription |
last_xact_flush_lsn | timestamptz | LSN of last transaction replayed on this subscription that's flushed durably to disk |
last_xact_replay_timestamp | timestamptz | Timestamp of last transaction replayed on this subscription |
bdr.replication_status
This view shows incoming replication status between the local node and all other nodes in the EDB Postgres Distributed cluster. If this is a logical standby node, then only the status for its upstream node is shown. Similarly, replication status is not shown for subscriber-only nodes since they never send replication changes to other nodes.
bdr.replication_status
Columns
Column | Type | Description |
---|---|---|
node_id | oid | OID of the local node |
node_name | name | Name of the local node |
origin_node_id | oid | OID of the origin node |
origin_node_name | name | Name of the origin node |
sub_id | oid | OID of the subscription for this origin node |
sub_name | name | Name of the subscription for this origin node |
connected | boolean | Is this node connected to the origin node? |
replication_blocked | boolean | Is the replication currently blocked for this origin? |
connect_time | timestamp with time zone | Time when the current connection was established |
disconnect_time | timestamp with time zone | Time when the last connection was dropped |
uptime | interval | Duration since the current connection is active for this origin |
bdr.tables
This view lists information about table membership in replication sets. If a table exists in multiple replication sets, it will appear multiple times in this table.
bdr.tables
Columns
Name | Type | Description |
---|---|---|
relid | oid | The OID of the relation |
nspname | name | Name of the schema relation is in |
relname | name | Name of the relation |
set_name | name | Name of the replication set |
set_ops | text[] | List of replicated operations |
rel_columns | text[] | List of replicated columns (NULL = all columns) (*) |
row_filter | text | Row filtering expression |
conflict_detection | text | Conflict detection method used: row_origin (default), row_version or column_level |
(*) These columns are reserved for future use and should currently be NULL
bdr.trigger
Within this view, you can see all the stream triggers created.
Often triggers here are created from bdr.create_conflict_trigger
.
bdr.trigger
Columns
Name | Type | Description |
---|---|---|
trigger_id | oid | The ID of the trigger |
trigger_reloid | regclass | Name of the relating function |
trigger_pgtgid | oid | Postgres trigger ID |
trigger_type | char | Type of trigger call |
trigger_name | name | Name of the trigger |
bdr.triggers
An expanded view of bdr.trigger
with more easy to read columns.
Name | Type | Description |
---|---|---|
trigger_name | name | The name of the trigger |
event_manipulation | text | The operation(s) |
trigger_type | bdr.trigger_type | Type of trigger |
trigger_table | bdr.trigger_reloid | The table that calls it |
trigger_function | name | The function used |
bdr.workers
Information about running BDR worker processes.
This can be joined with bdr.stat_activity
using pid to get even more insight
into the state of BDR workers.
bdr.workers
Columns
Name | Type | Description |
---|---|---|
worker_pid | int | Process Id of the worker process |
worker_role | int | Numeric representation of worker role |
worker_role_name | text | Name of the worker role |
worker_subid | oid | Subscription Id if the worker is associated with one |
worker_commit_timestamp | timestamptz | Last commit timestamp processed by this worker if any |
worker_local_timestamp | timestamptz | Local time at which the above commit was processed if any |
bdr.worker_errors
A persistent log of errors from BDR background worker processes, which includes errors from the underlying pglogical worker processes.
bdr.worker_errors
Columns
Name | Type | Description |
---|---|---|
node_group_name | name | Name of the BDR group |
origin_name | name | Name of the origin node |
source_name | name | |
target_name | name | Name of the target node (normally local node) |
sub_name | name | Name of the subscription |
worker_role | int4 | Internal identifier of the role of this worker (1: manager, 2: receive, 3: writer, 4: output, 5: extension) |
worker_role_name | text | Role name |
worker_pid | int4 | Process id of the worker causing the error |
error_time | timestamptz | Date and time of the error |
error_age | interval | Duration since error |
error_message | text | Description of the error |
error_context_message | text | Context in which the error happened |
remoterelid | oid | Oid of remote relation on that node |
subwriter_id | oid | |
subwriter_name | name |
bdr.autopartition_work_queue
Contains work items created and processed by autopartition worker. The work items are created on only one node and processed on different nodes.
bdr.autopartition_work_queue
Columns
Column | Type | Description |
---|---|---|
ap_wq_workid | bigint | The Unique ID of the work item |
ap_wq_ruleid | int | ID of the rule listed in autopartition_rules. Rules are specified using bdr.autopartition command |
ap_wq_relname | name | Name of the relation being autopartitioned |
ap_wq_relnamespace | name | Name of the tablespace specified in rule for this work item. |
ap_wq_partname | name | Name of the partition created by the workitem |
ap_wq_work_kind | char | The work kind can be either 'c' (Create Partition), 'm' (Migrate Partition), 'd' (Drop Partition), 'a' (Alter Partition) |
ap_wq_work_sql | text | SQL query for the work item |
ap_wq_work_depends | Oid[] | Oids of the nodes on which the work item depends |
bdr.autopartition_workitem_status
The status of the work items which is updated locally on each node.
bdr.autopartition_workitem_status
Columns
Column | Type | Description |
---|---|---|
ap_wi_workid | bigint | The ID of the work item |
ap_wi_nodeid | Oid | Oid of the node on which the work item is being processed |
ap_wi_status | char | The status can be either 'q' (Queued), 'c' (Complete), 'f' (Failed), 'u' (Unknown) |
ap_wi_started_at | timestamptz | The start timestamptz of work item |
ap_wi_finished_at | timestamptz | The end timestamptz of work item |
bdr.autopartition_local_work_queue
Contains work items created and processed by autopartition worker. This is similar to bdr.autopartition_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.autopartition_local_work_queue
Columns
Column | Type | Description |
---|---|---|
ap_wq_workid | bigint | The Unique ID of the work item |
ap_wq_ruleid | int | ID of the rule listed in autopartition_rules. Rules are specified using bdr.autopartition command |
ap_wq_relname | name | Name of the relation being autopartitioned |
ap_wq_relnamespace | name | Name of the tablespace specified in rule for this work item. |
ap_wq_partname | name | Name of the partition created by the workitem |
ap_wq_work_kind | char | The work kind can be either 'c' (Create Partition), 'm' (Migrate Partition), 'd' (Drop Partition), 'a' (Alter Partition) |
ap_wq_work_sql | text | SQL query for the work item |
ap_wq_work_depends | Oid[] | Always NULL |
bdr.autopartition_local_workitem_status
The status of the work items for locally managed tables.
bdr.autopartition_local_workitem_status
Columns
Column | Type | Description |
---|---|---|
ap_wi_workid | bigint | The ID of the work item |
ap_wi_nodeid | Oid | Oid of the node on which the work item is being processed |
ap_wi_status | char | The status can be either 'q' (Queued), 'c' (Complete), 'f' (Failed), 'u' (Unknown) |
ap_wi_started_at | timestamptz | The start timestamptz of work item |
ap_wi_finished_at | timestamptz | The end timestamptz of work item |
bdr.group_camo_details
Uses bdr.run_on_all_nodes
to gather CAMO-related information from all nodes.
bdr.group_camo_details
Columns
Name | Type | Description |
---|---|---|
node_id | text | Internal node id |
node_name | text | Name of the node |
camo_partner_of | text | Node name for whom this node is partner |
camo_origin_for | text | Node name for whom this node is origin |
is_camo_partner_connected | text | Connection status |
is_camo_partner_ready | text | Readiness status |
camo_transactions_resolved | text | Are there any pending and unresolved CAMO transactions |
apply_lsn | text | Latest position reported as replayed (visible) |
receive_lsn | text | Latest LSN of any change or message received (can go backwards in case of restarts) |
apply_queue_size | text | Bytes difference between apply_lsn and receive_lsn |
Note
This catalog is only present when bdr-enterprise extension is installed.
bdr.group_raft_details
Uses bdr.run_on_all_nodes
to gather Raft Consensus status from all nodes.
bdr.group_raft_details
Columns
Name | Type | Description |
---|---|---|
node_id | oid | Internal node id |
node_name | name | Name of the node |
state | text | Raft worker state on the node |
leader_id | oid | Node id of the RAFT_LEADER |
current_term | int | Raft election internal id |
commit_index | int | Raft snapshot internal id |
nodes | int | Number of nodes accessible |
voting_nodes | int | Number of nodes voting |
protocol_version | int | Protocol version for this node |
bdr.group_replslots_details
Uses bdr.run_on_all_nodes
to gather BDR/pglogical slot information from all nodes.
bdr.group_replslots_details
Columns
Name | Type | Description |
---|---|---|
node_group_name | text | Name of the BDR group |
origin_name | text | Name of the origin node |
target_name | text | Name of the target node |
slot_name | text | Slot name on the origin node used by this subscription |
active | text | Is the slot active (does it have a connection attached to it) |
state | text | State of the replication (catchup, streaming, ...) or 'disconnected' if offline |
write_lag | interval | Approximate lag time for reported write |
flush_lag | interval | Approximate lag time for reported flush |
replay_lag | interval | Approximate lag time for reported replay |
sent_lag_bytes | int8 | Bytes difference between sent_lsn and current WAL write position |
write_lag_bytes | int8 | Bytes difference between write_lsn and current WAL write position |
flush_lag_bytes | int8 | Bytes difference between flush_lsn and current WAL write position |
replay_lag_byte | int8 | Bytes 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
Name | Type | Description |
---|---|---|
origin_node_name | text | Name of the origin of the subscription |
target_node_name | text | Name of the target of the subscription |
last_xact_replay_timestamp | text | Timestamp of the last replayed transaction |
sub_lag_seconds | text | Lag between now and last_xact_replay_timestamp |
bdr.group_versions_details
Uses bdr.run_on_all_nodes
to gather BDR/pglogical information from all nodes.
bdr.group_versions_details
Columns
Name | Type | Description |
---|---|---|
node_id | oid | Internal node id |
node_name | name | Name of the node |
postgres_version | text | PostgreSQL version on the node |
pglogical_version | text | Pglogical version on the node |
bdr_version | text | BDR version on the node |
bdr_edition | text | BDR edition (SE or EE) on the node |
Internal Catalogs and Views
bdr.ddl_epoch
An internal catalog table holding state per DDL epoch.
bdr.ddl_epoch
Columns
Name | Type | Description |
---|---|---|
ddl_epoch | int8 | Monotonically increasing epoch number |
origin_node_id | oid | Internal node id of the node that requested creation of this epoch |
epoch_consume_timeout | timestamptz | Timeout of this epoch |
epoch_consumed | boolean | Switches to true as soon as the local node has fully processed the epoch |
bdr.internal_node_pre_commit
Internal catalog table; please use the bdr.node_pre_commit
view.
Note
This catalog is only present when bdr-enterprise extension is installed.
bdr.sequence_kind
An internal state table storing the type of each non-local sequence. The view
bdr.sequences
is recommended for diagnostic purposes.
bdr.sequence_kind
Columns
Name | Type | Description |
---|---|---|
seqid | oid | Internal OID of the sequence |
seqkind | char | Internal sequence kind ('l'=local,'t'=timeshard,'g'=galloc) |
bdr.state_journal
An internal node state journal. Please use bdr.state_journal_details
for
diagnostic purposes instead.
bdr.state_journal_details
Every change of node state of each node is logged permanently in bdr.state_journal
for diagnostic purposes.
This view provides node names and human-readable state names and carries all of
the information in that journal.
Once a node has successfully joined, the last state entry will be
BDR_PEER_STATE_ACTIVE
. This differs from the state of each replication connection
listed in bdr.node_slots.state
.
bdr.state_journal_details
Columns
Name | Type | Description |
---|---|---|
state_counter | oid | Monotonically increasing event counter, per node |
node_id | oid | Internal node id |
node_name | name | Name of the node |
state | oid | Internal state id |
state_name | text | Human-readable state name |
entered_time | timestamptz | Point in time the current node observed the state change |