summaryrefslogtreecommitdiff
path: root/contrib/pageinspect/heapfuncs.c
diff options
context:
space:
mode:
authorTom Lane2017-02-03 16:34:41 +0000
committerTom Lane2017-02-03 16:34:47 +0000
commit14e9b18fed289e483ed28daec60fdab95da9cc48 (patch)
tree928ca1c449c1ba884748758d2d52959c3af76881 /contrib/pageinspect/heapfuncs.c
parent29e312bc1301061ae9f897ff39f3b230c421a5fb (diff)
In pageinspect/hashfuncs.c, avoid crashes on alignment-picky machines.
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/[email protected]
Diffstat (limited to 'contrib/pageinspect/heapfuncs.c')
-rw-r--r--contrib/pageinspect/heapfuncs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/pageinspect/heapfuncs.c b/contrib/pageinspect/heapfuncs.c
index 748b1db0930..1448effb503 100644
--- a/contrib/pageinspect/heapfuncs.c
+++ b/contrib/pageinspect/heapfuncs.c
@@ -25,6 +25,8 @@
#include "postgres.h"
+#include "pageinspect.h"
+
#include "access/htup_details.h"
#include "funcapi.h"
#include "catalog/pg_type.h"