@@ -2525,6 +2525,24 @@ pub const InvalidLocalTransactionId: u32 = 0;
2525
2525
pub const MAX_LOCKMODES: u32 = 10;
2526
2526
pub const DEFAULT_LOCKMETHOD: u32 = 1;
2527
2527
pub const USER_LOCKMETHOD: u32 = 2;
2528
+ pub const PG_CONTROL_VERSION: u32 = 1300;
2529
+ pub const MOCK_AUTH_NONCE_LEN: u32 = 32;
2530
+ pub const XLOG_CHECKPOINT_SHUTDOWN: u32 = 0;
2531
+ pub const XLOG_CHECKPOINT_ONLINE: u32 = 16;
2532
+ pub const XLOG_NOOP: u32 = 32;
2533
+ pub const XLOG_NEXTOID: Oid = Oid(48);
2534
+ pub const XLOG_SWITCH: u32 = 64;
2535
+ pub const XLOG_BACKUP_END: u32 = 80;
2536
+ pub const XLOG_PARAMETER_CHANGE: u32 = 96;
2537
+ pub const XLOG_RESTORE_POINT: u32 = 112;
2538
+ pub const XLOG_FPW_CHANGE: u32 = 128;
2539
+ pub const XLOG_END_OF_RECOVERY: u32 = 144;
2540
+ pub const XLOG_FPI_FOR_HINT: u32 = 160;
2541
+ pub const XLOG_FPI: u32 = 176;
2542
+ pub const XLOG_OVERWRITE_CONTRECORD: u32 = 208;
2543
+ pub const FLOATFORMAT_VALUE: f64 = 1234567.0;
2544
+ pub const PG_CONTROL_MAX_SAFE_SIZE: u32 = 512;
2545
+ pub const PG_CONTROL_FILE_SIZE: u32 = 8192;
2528
2546
pub const PERFORM_DELETION_INTERNAL: u32 = 1;
2529
2547
pub const PERFORM_DELETION_CONCURRENTLY: u32 = 2;
2530
2548
pub const PERFORM_DELETION_QUIETLY: u32 = 4;
@@ -31624,6 +31642,287 @@ extern "C" {
31624
31642
extern "C" {
31625
31643
pub fn AlterTableGetRelOptionsLockLevel(defList: *mut List) -> LOCKMODE;
31626
31644
}
31645
+ #[repr(C)]
31646
+ #[derive(Debug, Copy, Clone)]
31647
+ pub struct CheckPoint {
31648
+ pub redo: XLogRecPtr,
31649
+ pub ThisTimeLineID: TimeLineID,
31650
+ pub PrevTimeLineID: TimeLineID,
31651
+ pub fullPageWrites: bool,
31652
+ pub nextXid: FullTransactionId,
31653
+ pub nextOid: Oid,
31654
+ pub nextMulti: MultiXactId,
31655
+ pub nextMultiOffset: MultiXactOffset,
31656
+ pub oldestXid: TransactionId,
31657
+ pub oldestXidDB: Oid,
31658
+ pub oldestMulti: MultiXactId,
31659
+ pub oldestMultiDB: Oid,
31660
+ pub time: pg_time_t,
31661
+ pub oldestCommitTsXid: TransactionId,
31662
+ pub newestCommitTsXid: TransactionId,
31663
+ pub oldestActiveXid: TransactionId,
31664
+ }
31665
+ impl Default for CheckPoint {
31666
+ fn default() -> Self {
31667
+ let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
31668
+ unsafe {
31669
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
31670
+ s.assume_init()
31671
+ }
31672
+ }
31673
+ }
31674
+ pub const DBState_DB_STARTUP: DBState = 0;
31675
+ pub const DBState_DB_SHUTDOWNED: DBState = 1;
31676
+ pub const DBState_DB_SHUTDOWNED_IN_RECOVERY: DBState = 2;
31677
+ pub const DBState_DB_SHUTDOWNING: DBState = 3;
31678
+ pub const DBState_DB_IN_CRASH_RECOVERY: DBState = 4;
31679
+ pub const DBState_DB_IN_ARCHIVE_RECOVERY: DBState = 5;
31680
+ pub const DBState_DB_IN_PRODUCTION: DBState = 6;
31681
+ pub type DBState = ::std::os::raw::c_uint;
31682
+ #[repr(C)]
31683
+ #[derive(Debug, Copy, Clone)]
31684
+ pub struct ControlFileData {
31685
+ pub system_identifier: uint64,
31686
+ pub pg_control_version: uint32,
31687
+ pub catalog_version_no: uint32,
31688
+ pub state: DBState,
31689
+ pub time: pg_time_t,
31690
+ pub checkPoint: XLogRecPtr,
31691
+ pub checkPointCopy: CheckPoint,
31692
+ pub unloggedLSN: XLogRecPtr,
31693
+ pub minRecoveryPoint: XLogRecPtr,
31694
+ pub minRecoveryPointTLI: TimeLineID,
31695
+ pub backupStartPoint: XLogRecPtr,
31696
+ pub backupEndPoint: XLogRecPtr,
31697
+ pub backupEndRequired: bool,
31698
+ pub wal_level: ::std::os::raw::c_int,
31699
+ pub wal_log_hints: bool,
31700
+ pub MaxConnections: ::std::os::raw::c_int,
31701
+ pub max_worker_processes: ::std::os::raw::c_int,
31702
+ pub max_wal_senders: ::std::os::raw::c_int,
31703
+ pub max_prepared_xacts: ::std::os::raw::c_int,
31704
+ pub max_locks_per_xact: ::std::os::raw::c_int,
31705
+ pub track_commit_timestamp: bool,
31706
+ pub maxAlign: uint32,
31707
+ pub floatFormat: f64,
31708
+ pub blcksz: uint32,
31709
+ pub relseg_size: uint32,
31710
+ pub xlog_blcksz: uint32,
31711
+ pub xlog_seg_size: uint32,
31712
+ pub nameDataLen: uint32,
31713
+ pub indexMaxKeys: uint32,
31714
+ pub toast_max_chunk_size: uint32,
31715
+ pub loblksize: uint32,
31716
+ pub float8ByVal: bool,
31717
+ pub data_checksum_version: uint32,
31718
+ pub mock_authentication_nonce: [::std::os::raw::c_char; 32usize],
31719
+ pub crc: pg_crc32c,
31720
+ }
31721
+ impl Default for ControlFileData {
31722
+ fn default() -> Self {
31723
+ let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
31724
+ unsafe {
31725
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
31726
+ s.assume_init()
31727
+ }
31728
+ }
31729
+ }
31730
+ pub const RecoveryTargetType_RECOVERY_TARGET_UNSET: RecoveryTargetType = 0;
31731
+ pub const RecoveryTargetType_RECOVERY_TARGET_XID: RecoveryTargetType = 1;
31732
+ pub const RecoveryTargetType_RECOVERY_TARGET_TIME: RecoveryTargetType = 2;
31733
+ pub const RecoveryTargetType_RECOVERY_TARGET_NAME: RecoveryTargetType = 3;
31734
+ pub const RecoveryTargetType_RECOVERY_TARGET_LSN: RecoveryTargetType = 4;
31735
+ pub const RecoveryTargetType_RECOVERY_TARGET_IMMEDIATE: RecoveryTargetType = 5;
31736
+ pub type RecoveryTargetType = ::std::os::raw::c_uint;
31737
+ pub const RecoveryTargetTimeLineGoal_RECOVERY_TARGET_TIMELINE_CONTROLFILE:
31738
+ RecoveryTargetTimeLineGoal = 0;
31739
+ pub const RecoveryTargetTimeLineGoal_RECOVERY_TARGET_TIMELINE_LATEST: RecoveryTargetTimeLineGoal =
31740
+ 1;
31741
+ pub const RecoveryTargetTimeLineGoal_RECOVERY_TARGET_TIMELINE_NUMERIC: RecoveryTargetTimeLineGoal =
31742
+ 2;
31743
+ pub type RecoveryTargetTimeLineGoal = ::std::os::raw::c_uint;
31744
+ pub const RecoveryPauseState_RECOVERY_NOT_PAUSED: RecoveryPauseState = 0;
31745
+ pub const RecoveryPauseState_RECOVERY_PAUSE_REQUESTED: RecoveryPauseState = 1;
31746
+ pub const RecoveryPauseState_RECOVERY_PAUSED: RecoveryPauseState = 2;
31747
+ pub type RecoveryPauseState = ::std::os::raw::c_uint;
31748
+ extern "C" {
31749
+ pub static mut recoveryTargetInclusive: bool;
31750
+ }
31751
+ extern "C" {
31752
+ pub static mut recoveryTargetAction: ::std::os::raw::c_int;
31753
+ }
31754
+ extern "C" {
31755
+ pub static mut recovery_min_apply_delay: ::std::os::raw::c_int;
31756
+ }
31757
+ extern "C" {
31758
+ pub static mut PrimaryConnInfo: *mut ::std::os::raw::c_char;
31759
+ }
31760
+ extern "C" {
31761
+ pub static mut PrimarySlotName: *mut ::std::os::raw::c_char;
31762
+ }
31763
+ extern "C" {
31764
+ pub static mut recoveryEndCommand: *mut ::std::os::raw::c_char;
31765
+ }
31766
+ extern "C" {
31767
+ pub static mut archiveCleanupCommand: *mut ::std::os::raw::c_char;
31768
+ }
31769
+ extern "C" {
31770
+ pub static mut recoveryTargetXid: TransactionId;
31771
+ }
31772
+ extern "C" {
31773
+ pub static mut recovery_target_time_string: *mut ::std::os::raw::c_char;
31774
+ }
31775
+ extern "C" {
31776
+ pub static mut recoveryTargetTime: TimestampTz;
31777
+ }
31778
+ extern "C" {
31779
+ pub static mut recoveryTargetName: *const ::std::os::raw::c_char;
31780
+ }
31781
+ extern "C" {
31782
+ pub static mut recoveryTargetLSN: XLogRecPtr;
31783
+ }
31784
+ extern "C" {
31785
+ pub static mut recoveryTarget: RecoveryTargetType;
31786
+ }
31787
+ extern "C" {
31788
+ pub static mut PromoteTriggerFile: *mut ::std::os::raw::c_char;
31789
+ }
31790
+ extern "C" {
31791
+ pub static mut wal_receiver_create_temp_slot: bool;
31792
+ }
31793
+ extern "C" {
31794
+ pub static mut recoveryTargetTimeLineGoal: RecoveryTargetTimeLineGoal;
31795
+ }
31796
+ extern "C" {
31797
+ pub static mut recoveryTargetTLIRequested: TimeLineID;
31798
+ }
31799
+ extern "C" {
31800
+ pub static mut recoveryTargetTLI: TimeLineID;
31801
+ }
31802
+ extern "C" {
31803
+ pub static mut reachedConsistency: bool;
31804
+ }
31805
+ #[pgrx_macros::pg_guard]
31806
+ extern "C" {
31807
+ pub fn XLogRecoveryShmemSize() -> Size;
31808
+ }
31809
+ #[pgrx_macros::pg_guard]
31810
+ extern "C" {
31811
+ pub fn XLogRecoveryShmemInit();
31812
+ }
31813
+ #[pgrx_macros::pg_guard]
31814
+ extern "C" {
31815
+ pub fn InitWalRecovery(
31816
+ ControlFile: *mut ControlFileData,
31817
+ wasShutdownPtr: *mut bool,
31818
+ haveBackupLabel: *mut bool,
31819
+ haveTblspcMap: *mut bool,
31820
+ );
31821
+ }
31822
+ #[pgrx_macros::pg_guard]
31823
+ extern "C" {
31824
+ pub fn PerformWalRecovery();
31825
+ }
31826
+ #[repr(C)]
31827
+ #[derive(Debug, Copy, Clone)]
31828
+ pub struct EndOfWalRecoveryInfo {
31829
+ pub lastRec: XLogRecPtr,
31830
+ pub lastRecTLI: TimeLineID,
31831
+ pub endOfLog: XLogRecPtr,
31832
+ pub endOfLogTLI: TimeLineID,
31833
+ pub lastPageBeginPtr: XLogRecPtr,
31834
+ pub lastPage: *mut ::std::os::raw::c_char,
31835
+ pub abortedRecPtr: XLogRecPtr,
31836
+ pub missingContrecPtr: XLogRecPtr,
31837
+ pub recoveryStopReason: *mut ::std::os::raw::c_char,
31838
+ pub standby_signal_file_found: bool,
31839
+ pub recovery_signal_file_found: bool,
31840
+ }
31841
+ impl Default for EndOfWalRecoveryInfo {
31842
+ fn default() -> Self {
31843
+ let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
31844
+ unsafe {
31845
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
31846
+ s.assume_init()
31847
+ }
31848
+ }
31849
+ }
31850
+ #[pgrx_macros::pg_guard]
31851
+ extern "C" {
31852
+ pub fn FinishWalRecovery() -> *mut EndOfWalRecoveryInfo;
31853
+ }
31854
+ #[pgrx_macros::pg_guard]
31855
+ extern "C" {
31856
+ pub fn ShutdownWalRecovery();
31857
+ }
31858
+ #[pgrx_macros::pg_guard]
31859
+ extern "C" {
31860
+ pub fn RemovePromoteSignalFiles();
31861
+ }
31862
+ #[pgrx_macros::pg_guard]
31863
+ extern "C" {
31864
+ pub fn HotStandbyActive() -> bool;
31865
+ }
31866
+ #[pgrx_macros::pg_guard]
31867
+ extern "C" {
31868
+ pub fn GetXLogReplayRecPtr(replayTLI: *mut TimeLineID) -> XLogRecPtr;
31869
+ }
31870
+ #[pgrx_macros::pg_guard]
31871
+ extern "C" {
31872
+ pub fn GetRecoveryPauseState() -> RecoveryPauseState;
31873
+ }
31874
+ #[pgrx_macros::pg_guard]
31875
+ extern "C" {
31876
+ pub fn SetRecoveryPause(recoveryPause: bool);
31877
+ }
31878
+ #[pgrx_macros::pg_guard]
31879
+ extern "C" {
31880
+ pub fn GetXLogReceiptTime(rtime: *mut TimestampTz, fromStream: *mut bool);
31881
+ }
31882
+ #[pgrx_macros::pg_guard]
31883
+ extern "C" {
31884
+ pub fn GetLatestXTime() -> TimestampTz;
31885
+ }
31886
+ #[pgrx_macros::pg_guard]
31887
+ extern "C" {
31888
+ pub fn GetCurrentChunkReplayStartTime() -> TimestampTz;
31889
+ }
31890
+ #[pgrx_macros::pg_guard]
31891
+ extern "C" {
31892
+ pub fn GetCurrentReplayRecPtr(replayEndTLI: *mut TimeLineID) -> XLogRecPtr;
31893
+ }
31894
+ #[pgrx_macros::pg_guard]
31895
+ extern "C" {
31896
+ pub fn PromoteIsTriggered() -> bool;
31897
+ }
31898
+ #[pgrx_macros::pg_guard]
31899
+ extern "C" {
31900
+ pub fn CheckPromoteSignal() -> bool;
31901
+ }
31902
+ #[pgrx_macros::pg_guard]
31903
+ extern "C" {
31904
+ pub fn WakeupRecovery();
31905
+ }
31906
+ #[pgrx_macros::pg_guard]
31907
+ extern "C" {
31908
+ pub fn StartupRequestWalReceiverRestart();
31909
+ }
31910
+ #[pgrx_macros::pg_guard]
31911
+ extern "C" {
31912
+ pub fn XLogRequestWalReceiverReply();
31913
+ }
31914
+ #[pgrx_macros::pg_guard]
31915
+ extern "C" {
31916
+ pub fn RecoveryRequiresIntParameter(
31917
+ param_name: *const ::std::os::raw::c_char,
31918
+ currValue: ::std::os::raw::c_int,
31919
+ minValue: ::std::os::raw::c_int,
31920
+ );
31921
+ }
31922
+ #[pgrx_macros::pg_guard]
31923
+ extern "C" {
31924
+ pub fn xlog_outdesc(buf: StringInfo, record: *mut XLogReaderState);
31925
+ }
31627
31926
pub const DependencyType_DEPENDENCY_NORMAL: DependencyType = 110;
31628
31927
pub const DependencyType_DEPENDENCY_AUTO: DependencyType = 97;
31629
31928
pub const DependencyType_DEPENDENCY_INTERNAL: DependencyType = 105;
0 commit comments