mirror of
https://github.com/postgres/postgres.git
synced 2025-05-09 18:21:05 +03:00
On machines with MAXALIGN = 8, the payload of a bytea is not maxaligned, since it will start 4 bytes into a palloc'd value. On alignment-picky hardware, this will cause failures in accesses to 8-byte-wide values within the page. We already encountered this problem when we introduced GIN index inspection functions, and fixed it in commit 84ad68d64. Make use of the same function for hash indexes. A small difficulty is that up to now contrib/pageinspect has not shared any functions at all across files. To support that, introduce a common header file "pageinspect.h" for the module. Also, move get_page_from_raw() out of ginfuncs.c, where it didn't especially belong, and put it in rawpage.c which seems a more natural home. Per buildfarm. Discussion: https://postgr.es/m/17311.1486134714@sss.pgh.pa.us
22 lines
518 B
C
22 lines
518 B
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* pageinspect.h
|
|
* Common functions for pageinspect.
|
|
*
|
|
* Copyright (c) 2017, PostgreSQL Global Development Group
|
|
*
|
|
* IDENTIFICATION
|
|
* contrib/pageinspect/pageinspect.h
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef _PAGEINSPECT_H_
|
|
#define _PAGEINSPECT_H_
|
|
|
|
#include "storage/bufpage.h"
|
|
|
|
/* in rawpage.c */
|
|
extern Page get_page_from_raw(bytea *raw_page);
|
|
|
|
#endif /* _PAGEINSPECT_H_ */
|