PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
pageinspect.h File Reference
#include "storage/bufpage.h"
Include dependency graph for pageinspect.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  pageinspect_version { PAGEINSPECT_V1_8 , PAGEINSPECT_V1_9 }
 

Functions

Page get_page_from_raw (bytea *raw_page)
 

Enumeration Type Documentation

◆ pageinspect_version

Enumerator
PAGEINSPECT_V1_8 
PAGEINSPECT_V1_9 

Definition at line 21 of file pageinspect.h.

22{
25};
@ PAGEINSPECT_V1_9
Definition: pageinspect.h:24
@ PAGEINSPECT_V1_8
Definition: pageinspect.h:23

Function Documentation

◆ get_page_from_raw()

Page get_page_from_raw ( bytea raw_page)

Definition at line 218 of file rawpage.c.

219{
220 Page page;
221 int raw_page_size;
222
223 raw_page_size = VARSIZE_ANY_EXHDR(raw_page);
224
225 if (raw_page_size != BLCKSZ)
227 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
228 errmsg("invalid page size"),
229 errdetail("Expected %d bytes, got %d.",
230 BLCKSZ, raw_page_size)));
231
232 page = palloc(raw_page_size);
233
234 memcpy(page, VARDATA_ANY(raw_page), raw_page_size);
235
236 return page;
237}
PageData * Page
Definition: bufpage.h:82
int errdetail(const char *fmt,...)
Definition: elog.c:1204
int errcode(int sqlerrcode)
Definition: elog.c:854
int errmsg(const char *fmt,...)
Definition: elog.c:1071
#define ERROR
Definition: elog.h:39
#define ereport(elevel,...)
Definition: elog.h:149
void * palloc(Size size)
Definition: mcxt.c:1943
#define VARDATA_ANY(PTR)
Definition: varatt.h:324
#define VARSIZE_ANY_EXHDR(PTR)
Definition: varatt.h:317

References ereport, errcode(), errdetail(), errmsg(), ERROR, palloc(), VARDATA_ANY, and VARSIZE_ANY_EXHDR.

Referenced by brin_page_type(), bt_page_items_bytea(), fsm_page_contents(), gin_leafpage_items(), gin_metapage_info(), gin_page_opaque_info(), page_checksum_internal(), page_header(), verify_brin_page(), verify_gist_page(), and verify_hash_page().