diff --git a/controldata.c b/controldata.c index 4f61cbac..d2180d84 100644 --- a/controldata.c +++ b/controldata.c @@ -310,7 +310,18 @@ get_controlfile(const char *DataDir) control_file_info->control_file_processed = true; - if (version_num >= 110000) + if (version_num >= 120000) + { + ControlFileData12 *ptr = (struct ControlFileData12 *)ControlFileDataPtr; + control_file_info->system_identifier = ptr->system_identifier; + control_file_info->state = ptr->state; + control_file_info->checkPoint = ptr->checkPoint; + control_file_info->data_checksum_version = ptr->data_checksum_version; + control_file_info->timeline = ptr->checkPointCopy.ThisTimeLineID; + control_file_info->minRecoveryPointTLI = ptr->minRecoveryPointTLI; + control_file_info->minRecoveryPoint = ptr->minRecoveryPoint; + } + else if (version_num >= 110000) { ControlFileData11 *ptr = (struct ControlFileData11 *)ControlFileDataPtr; control_file_info->system_identifier = ptr->system_identifier; diff --git a/controldata.h b/controldata.h index 73aeae67..2dccea8f 100644 --- a/controldata.h +++ b/controldata.h @@ -333,6 +333,72 @@ typedef struct ControlFileData11 } ControlFileData11; +/* + * Following field added in Pg12: + * + * int max_wal_senders; + * + * Following fields removed: + * + * uint32 nextXidEpoch; + * TransactionId nextXid; + * + * and replaced by: + * + * FullTransactionId nextFullXid; + */ + +typedef struct ControlFileData12 +{ + uint64 system_identifier; + + uint32 pg_control_version; /* PG_CONTROL_VERSION */ + uint32 catalog_version_no; /* see catversion.h */ + + DBState state; /* see enum above */ + pg_time_t time; /* time stamp of last pg_control update */ + XLogRecPtr checkPoint; /* last check point record ptr */ + + CheckPoint checkPointCopy; /* copy of last check point record */ + + XLogRecPtr unloggedLSN; /* current fake LSN value, for unlogged rels */ + + XLogRecPtr minRecoveryPoint; + TimeLineID minRecoveryPointTLI; + XLogRecPtr backupStartPoint; + XLogRecPtr backupEndPoint; + bool backupEndRequired; + + int wal_level; + bool wal_log_hints; + int MaxConnections; + int max_worker_processes; + int max_wal_senders; + int max_prepared_xacts; + int max_locks_per_xact; + bool track_commit_timestamp; + + uint32 maxAlign; /* alignment requirement for tuples */ + double floatFormat; /* constant 1234567.0 */ + + uint32 blcksz; /* data block size for this DB */ + uint32 relseg_size; /* blocks per segment of large relation */ + + uint32 xlog_blcksz; /* block size within WAL files */ + uint32 xlog_seg_size; /* size of each WAL segment */ + + uint32 nameDataLen; /* catalog name field width */ + uint32 indexMaxKeys; /* max number of columns in an index */ + + uint32 toast_max_chunk_size; /* chunk size in TOAST tables */ + uint32 loblksize; /* chunk size in pg_largeobject */ + + bool float4ByVal; /* float4 pass-by-value? */ + bool float8ByVal; /* float8, int8, etc pass-by-value? */ + + uint32 data_checksum_version; +} ControlFileData12; + extern int get_pg_version(const char *data_directory, char *version_string); extern DBState get_db_state(const char *data_directory); extern const char *describe_db_state(DBState state);