1/*
2 * brin_pageops.h
3 * Prototypes for operating on BRIN pages.
4 *
5 * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
6 * Portions Copyright (c) 1994, Regents of the University of California
7 *
8 * IDENTIFICATION
9 * src/include/access/brin_pageops.h
10 */
11#ifndef BRIN_PAGEOPS_H
12#define BRIN_PAGEOPS_H
13
14#include "access/brin_revmap.h"
15
16extern bool brin_doupdate(Relation idxrel, BlockNumber pagesPerRange,
17 BrinRevmap *revmap, BlockNumber heapBlk,
18 Buffer oldbuf, OffsetNumber oldoff,
19 const BrinTuple *origtup, Size origsz,
20 const BrinTuple *newtup, Size newsz,
21 bool samepage);
22extern bool brin_can_do_samepage_update(Buffer buffer, Size origsz,
23 Size newsz);
24extern OffsetNumber brin_doinsert(Relation idxrel, BlockNumber pagesPerRange,
25 BrinRevmap *revmap, Buffer *buffer, BlockNumber heapBlk,
26 BrinTuple *tup, Size itemsz);
27
28extern void brin_page_init(Page page, uint16 type);
29extern void brin_metapage_init(Page page, BlockNumber pagesPerRange,
30 uint16 version);
31
32extern bool brin_start_evacuating_page(Relation idxRel, Buffer buf);
33extern void brin_evacuate_page(Relation idxRel, BlockNumber pagesPerRange,
34 BrinRevmap *revmap, Buffer buf);
35
36extern void brin_page_cleanup(Relation idxrel, Buffer buf);
37
38#endif /* BRIN_PAGEOPS_H */
39