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 */
33
34/*
35 * Compute the checksum for a Postgres page. The page must be aligned on a
36 * 4-byte boundary.
37 */
38extern uint16 pg_checksum_page(char *page, BlockNumber blkno);
39
40#endif /* CHECKSUM_H */
uint32 BlockNumber
Definition block.h:31
uint16_t uint16
Definition c.h:623
ChecksumStateType
Definition checksum.h:27
@ PG_DATA_CHECKSUM_VERSION
Definition checksum.h:29
@ PG_DATA_CHECKSUM_INPROGRESS_OFF
Definition checksum.h:30
@ PG_DATA_CHECKSUM_INPROGRESS_ON
Definition checksum.h:31
@ PG_DATA_CHECKSUM_OFF
Definition checksum.h:28
uint16 pg_checksum_page(char *page, BlockNumber blkno)