PostgreSQL Source Code
git master
Loading...
Searching...
No Matches
checksum.h
Go to the documentation of this file.
1
/*-------------------------------------------------------------------------
2
*
3
* checksum.h
4
* Checksum implementation for data pages.
5
*
6
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
7
* Portions Copyright (c) 1994, Regents of the University of California
8
*
9
* src/include/storage/checksum.h
10
*
11
*-------------------------------------------------------------------------
12
*/
13
#ifndef CHECKSUM_H
14
#define CHECKSUM_H
15
16
#include "
storage/block.h
"
17
18
/*
19
* Checksum state 0 is used for when data checksums are disabled (OFF).
20
* PG_DATA_CHECKSUM_INPROGRESS_{ON|OFF} defines that data checksums are either
21
* currently being enabled or disabled, and PG_DATA_CHECKSUM_VERSION defines
22
* that data checksums are enabled. The ChecksumStateType is stored in
23
* pg_control so changing requires a catversion bump, and the values cannot
24
* be reordered. New states must be added at the end.
25
*/
26
typedef
enum
ChecksumStateType
27
{
28
PG_DATA_CHECKSUM_OFF
= 0,
29
PG_DATA_CHECKSUM_VERSION
= 1,
30
PG_DATA_CHECKSUM_INPROGRESS_OFF
= 2,
31
PG_DATA_CHECKSUM_INPROGRESS_ON
= 3,
32
}
ChecksumStateType
;
33
34
/*
35
* Compute the checksum for a Postgres page. The page must be aligned on a
36
* 4-byte boundary.
37
*/
38
extern
uint16
pg_checksum_page
(
char
*page,
BlockNumber
blkno);
39
40
#endif
/* CHECKSUM_H */
block.h
BlockNumber
uint32 BlockNumber
Definition
block.h:31
uint16
uint16_t uint16
Definition
c.h:623
ChecksumStateType
ChecksumStateType
Definition
checksum.h:27
PG_DATA_CHECKSUM_VERSION
@ PG_DATA_CHECKSUM_VERSION
Definition
checksum.h:29
PG_DATA_CHECKSUM_INPROGRESS_OFF
@ PG_DATA_CHECKSUM_INPROGRESS_OFF
Definition
checksum.h:30
PG_DATA_CHECKSUM_INPROGRESS_ON
@ PG_DATA_CHECKSUM_INPROGRESS_ON
Definition
checksum.h:31
PG_DATA_CHECKSUM_OFF
@ PG_DATA_CHECKSUM_OFF
Definition
checksum.h:28
pg_checksum_page
uint16 pg_checksum_page(char *page, BlockNumber blkno)
Definition
checksum_impl.h:172
src
include
storage
checksum.h
Generated on Wed Apr 15 2026 07:13:16 for PostgreSQL Source Code by
1.9.8