本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
pgactive 函數參考
您可以在下面找到具有參數、傳回值和實際用量備註的 pgactive 函數清單,以協助您有效地使用這些函數:
get_last_applied_xact_info
擷取指定節點的上次套用交易資訊。
- Arguments (引數)
-
-
sysid (文字) - 時間軸 OID
-
dboid (OID)
-
- 傳回類型
-
它會記錄下列項目:
-
last_applied_xact_id (OID)
-
last_applied_xact_committs (含時區的時間戳記)
-
last_applied_xact_at (含時區的時間戳記)
-
- 使用須知
-
使用此函數可擷取指定節點的上次套用交易資訊。
pgactive_apply_pause
暫停複寫套用程序。
- Arguments (引數)
-
無
- 傳回類型
-
boolean
- 使用須知
-
呼叫此函數以暫停複寫套用程序。
pgactive_apply_resume
恢復複寫套用程序。
- Arguments (引數)
-
無
- 傳回類型
-
void
- 使用須知
-
呼叫此函數以繼續複寫套用程序。
pgactive_is_apply_paused
檢查複寫是否目前暫停。
- Arguments (引數)
-
無
- 傳回類型
-
boolean
- 使用須知
-
使用此函數來檢查複寫是否目前暫停。
pgactive_create_group
透過將獨立資料庫轉換為初始節點來建立 pgactive 群組。
- Arguments (引數)
-
-
node_name (文字)
-
node_dsn (文字)
-
apply_delay 整數 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 - flushlsn pg_lsn - replay_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 (文字)
-
node_dsn (文字)
-
join_using_dsn (文字)
-
apply_delay (整數,選用)
-
replication_sets (text【】,預設值:【'default'】)
-
bypass_collation_check (布林值,預設值:false)
-
bypass_node_identifier_creation (布林值,預設值:false)
-
bypass_user_tables_check (布林值,預設值:false)
-
- 傳回類型
-
void
- 使用須知
-
呼叫此函數,將節點新增至現有的 pgactive 群組。確保您的 PostgreSQL 叢集有足夠的 max_worker_processes 供 pgactive 背景工作者使用。
pgactive_remove
從本機節點移除所有 pgactive 元件。
- Arguments (引數)
-
-
force (布林值,預設值:false)
-
- 傳回類型
-
void
- 使用須知
-
呼叫此函數,從本機節點移除所有 pgactive 元件。
pgactive_snowflake_id_nextval
產生節點特定的唯一序列值。
- Arguments (引數)
-
-
regclass
-
- 傳回類型
-
bigint
- 使用須知
-
使用此函數來產生節點特定的唯一序列值。
pgactive_update_node_conninfo
更新 pgactive 節點的連線資訊。
- Arguments (引數)
-
-
node_name_to_update (文字)
-
node_dsn_to_update (文字)
-
- 傳回類型
-
void
- 使用須知
-
使用此函數更新 pgactive 節點的連線資訊。
pgactive_wait_for_node_ready
監控群組建立或聯結操作的進度。
- Arguments (引數)
-
-
逾時 (整數,預設值:0)
-
progress_interval (整數,預設值:60)
-
- 傳回類型
-
void
- 使用須知
-
呼叫此函數來監控群組建立或聯結操作的進度。