pgactive 函数参考
在下文中,您可以找到 pgactive 函数及其参数、返回值和实际使用说明,以助您高效使用它们:
get_last_applied_xact_info
检索指定节点的上次应用的事务信息。
- Arguments (参数)
-
-
sysid (text) - timeline OID
-
dboid (OID)
-
- 返回类型
-
它将记录以下内容:
-
last_applied_xact_id(OID)
-
last_applied_xact_committs(带时区的时间戳)
-
last_applied_xact_at(带时区的时间戳)
-
- 使用说明
-
使用此函数可检索指定节点的上次应用的事务信息。
pgactive_apply_pause
暂停复制应用进程。
- Arguments (参数)
-
无
- 返回类型
-
布尔值
- 使用说明
-
调用此函数可暂停复制应用进程。
pgactive_apply_resume
恢复复制应用进程。
- Arguments (参数)
-
无
- 返回类型
-
void
- 使用说明
-
调用此函数可恢复复制应用进程。
pgactive_is_apply_paused
检查复制应用当前是否已暂停。
- Arguments (参数)
-
无
- 返回类型
-
布尔值
- 使用说明
-
使用此函数可检查复制应用当前是否已暂停。
pgactive_create_group
通过将独立数据库转换为初始节点来创建 pgactive 组。
- Arguments (参数)
-
-
node_name (text)
-
node_dsn (text)
-
apply_delay integer DEFAULT NULL::integer - replication_sets text[] DEFAULT ARRAY[‘default’::text]
-
- 返回类型
-
void
- 使用说明
-
通过将独立数据库转换为初始节点来创建 pgactive 组。此函数在将节点转换为 pgactive 节点之前执行完整性检查。在使用此函数之前,请确保您的 PostgreSQL 集群有足够的可用
max_worker_processes
来支持 pgactive 后台工作线程。
pgactive_detach_nodes
从 pgactive 组中移除指定节点。
- Arguments (参数)
-
-
p_nodes (text[])
-
- 返回类型
-
void
- 使用说明
-
使用此函数可从 pgactive 组中移除指定节点。
pgactive_exclude_table_replication_set
将特定表排除在复制之外。
- Arguments (参数)
-
-
p_relation(regclass)
-
- 返回类型
-
void
- 使用说明
-
使用此函数可将特定表排除在复制之外。
pgactive_get_replication_lag_info
检索详细的复制滞后信息,包括节点详细信息、WAL 状态和 LSN 值。
- Arguments (参数)
-
无
- 返回类型
-
SETOF 记录 - node_name text - node_sysid text - application_name text - slot_name text - active boolean - active_pid integer - pending_wal_decoding bigint - 发送者节点上待解码的 WAL 的近似大小(以字节为单位)- pending_wal_to_apply bigint - 要在接收节点上应用的 WAL 的近似大小(以字节为单位)- restart_lsn pg_lsn - confirmed_flush_lsn pg_lsn - sent_lsn pg_lsn - write_lsn pg_lsn - flush_lsn pg_lsn - replay_lsn pg_lsn
- 使用说明
-
调用此函数可检索复制滞后信息,包括节点详细信息、WAL 状态和 LSN 值。
pgactive_get_stats
检索 pgactive 复制统计信息。
- Arguments (参数)
-
无
- 返回类型
-
SETOF 记录 - rep_node_id oid - rilocalid oid - riremoteid text - nr_commit bigint - nr_rollback bigint - nr_insert bigint - nr_insert_conflict bigint - nr_update bigint - nr_update_conflict bigint - nr_delete bigint - nr_delete_conflict bigint - nr_disconnect bigint
- 使用说明
-
使用此函数可检索 pgactive 复制统计信息。
pgactive_get_table_replication_sets
获取特定关系的复制集配置。
- Arguments (参数)
-
-
relation (regclass)
-
- 返回类型
-
SETOF 记录
- 使用说明
-
调用此函数可获取特定关系的复制集配置。
pgactive_include_table_replication_set
将特定表包含在复制中。
- Arguments (参数)
-
-
p_relation(regclass)
-
- 返回类型
-
void
- 使用说明
-
使用此函数可将特定表包含在复制中。
pgactive_join_group
向现有 pgactive 组添加节点。
- Arguments (参数)
-
-
node_name (text)
-
node_dsn (text)
-
join_using_dsn (text)
-
apply_delay (integer,可选)
-
replication_sets (text[],默认值:['default'])
-
bypass_collation_check (boolean,默认值:false)
-
bypass_node_identifier_creation (boolean,默认值:false)
-
bypass_user_tables_check (boolean,默认值:false)
-
- 返回类型
-
void
- 使用说明
-
调用此函数可将节点添加到现有 pgactive 组中。确保您的 PostgreSQL 集群有足够的 max_worker_processes 以供 pgactive 后台工作线程使用。
pgactive_remove
从本地节点中移除所有 pgactive 组件。
- Arguments (参数)
-
-
force (boolean,默认值:false)
-
- 返回类型
-
void
- 使用说明
-
调用此函数可从本地节点中移除所有 pgactive 组件。
pgactive_snowflake_id_nextval
生成特定于节点的唯一序列值。
- Arguments (参数)
-
-
regclass
-
- 返回类型
-
bigint
- 使用说明
-
使用此函数可生成特定于节点的唯一序列值。
pgactive_update_node_conninfo
更新 pgactive 节点的连接信息。
- Arguments (参数)
-
-
node_name_to_update (text)
-
node_dsn_to_update (text)
-
- 返回类型
-
void
- 使用说明
-
使用此函数可更新 pgactive 节点的连接信息。
pgactive_wait_for_node_ready
监控组创建或加入操作的进度。
- Arguments (参数)
-
-
timeout (integer,默认值:0)
-
progress_interval (integer,默认值:60)
-
- 返回类型
-
void
- 使用说明
-
调用此函数可监控组创建或加入操作的进度。