pg_controldata

一个用于显示数据库集群全局状态信息的服务器实用程序

pg_controldata 是一个 服务器实用程序,它显示存储在 global/pg_control 文件中的 数据库集群 的全局状态信息。这些信息包括在 initdb 过程中固定的集群特性(例如块大小),以及 WAL / 检查点 相关数据和 数据页校验和

pg_controldata 包含在 PostgreSQL 核心发行版中;在 PostgreSQL 7.3 之前,它是一个 contrib 模块

SQL 替代方案

PostgreSQL 9.6 开始,可以使用以下函数直接查询 pg_control 的内容

更改历史记录

示例

示例输出

$ pg_controldata -D /path/to/pgdata
pg_control version number:            1201
Catalog version number:               201909212
Database system identifier:           6872135480623396628
Database cluster state:               in archive recovery
pg_control last modified:             Mon 14 Sep 2020 09:35:29 AM UTC
Latest checkpoint location:           0/2000060
Latest checkpoint's REDO location:    0/2000028
Latest checkpoint's REDO WAL file:    000000010000000000000002
Latest checkpoint's TimeLineID:       1
Latest checkpoint's PrevTimeLineID:   1
Latest checkpoint's full_page_writes: on
Latest checkpoint's NextXID:          0:495
Latest checkpoint's NextOID:          24576
Latest checkpoint's NextMultiXactId:  1
Latest checkpoint's NextMultiOffset:  0
Latest checkpoint's oldestXID:        479
Latest checkpoint's oldestXID's DB:   1
Latest checkpoint's oldestActiveXID:  495
Latest checkpoint's oldestMultiXid:   1
Latest checkpoint's oldestMulti's DB: 1
Latest checkpoint's oldestCommitTsXid:0
Latest checkpoint's newestCommitTsXid:0
Time of latest checkpoint:            Mon 14 Sep 2020 09:35:28 AM UTC
Fake LSN counter for unlogged rels:   0/3E8
Minimum recovery ending location:     0/2000100
Min recovery ending loc's timeline:   1
Backup start location:                0/0
Backup end location:                  0/0
End-of-backup record required:        no
wal_level setting:                    replica
wal_log_hints setting:                on
max_connections setting:              20
max_worker_processes setting:         8
max_wal_senders setting:              10
max_prepared_xacts setting:           10
max_locks_per_xact setting:           64
track_commit_timestamp setting:       off
Maximum data alignment:               8
Database block size:                  8192
Blocks per segment of large relation: 131072
WAL block size:                       8192
Bytes per WAL segment:                16777216
Maximum length of identifiers:        64
Maximum columns in an index:          32
Maximum size of a TOAST chunk:        1996
Size of a large-object chunk:         2048
Date/time type storage:               64-bit integers
Float4 argument passing:              by value
Float8 argument passing:              by value
Data page checksum version:           1
Mock authentication nonce:            f5f96b5d2aee1c18e95333fb089ac55415aa1aef63158456fdcd09044f00bb32

分类

管理/运维PostgreSQL 内部机制复制服务器实用程序

另请参阅

pg_control_system()pg_control_checkpoint()pg_control_init()pg_control_recovery()IDENTIFY_SYSTEM

反馈

请提交您对“pg_controldata”的任何评论、建议或更正 此处