pg_hibernator icon indicating copy to clipboard operation
pg_hibernator copied to clipboard

Does not compile against PostgreSQL 9.6

Open teohhanhui opened this issue 9 years ago • 2 comments

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -I/usr/include/mit-krb5 -fPIC -pie -fno-omit-frame-pointer -fpic -I. -I./ -I/usr/include/postgresql/9.6/server -I/usr/include/postgresql/internal -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/tcl8.6  -c -o pg_hibernate.o pg_hibernate.c
pg_hibernate.c: In function ‘SaveBuffers’:
pg_hibernate.c:780:38: warning: assignment from incompatible pointer type
  for (num_buffers = 0, i = 0, bufHdr = BufferDescriptors; i < NBuffers; ++i, ++bufHdr)
                                      ^
pg_hibernate.c:783:14: warning: passing argument 1 of ‘LockBufHdr’ discards ‘volatile’ qualifier from pointer target type
   LockBufHdr(bufHdr);
              ^
In file included from pg_hibernator.h:23:0,
                 from pg_hibernate.c:5:
/usr/include/postgresql/9.6/server/storage/buf_internals.h:242:15: note: expected ‘struct BufferDesc *’ but argument is of type ‘volatile struct BufferDesc *’
 extern uint32 LockBufHdr(BufferDesc *desc);
               ^
pg_hibernate.c:786:14: error: ‘BufferDesc’ has no member named ‘flags’
   if ((bufHdr->flags & BM_VALID) && (bufHdr->flags & BM_TAG_VALID))
              ^
pg_hibernate.c:786:44: error: ‘BufferDesc’ has no member named ‘flags’
   if ((bufHdr->flags & BM_VALID) && (bufHdr->flags & BM_TAG_VALID))
                                            ^
pg_hibernate.c:796:22: error: macro "UnlockBufHdr" requires 2 arguments, but only 1 given
   UnlockBufHdr(bufHdr);
                      ^
pg_hibernate.c:796:3: error: ‘UnlockBufHdr’ undeclared (first use in this function)
   UnlockBufHdr(bufHdr);
   ^
pg_hibernate.c:796:3: note: each undeclared identifier is reported only once for each function it appears in
make: *** [pg_hibernate.o] Error 1
<builtin>: recipe for target 'pg_hibernate.o' failed

teohhanhui avatar Oct 27 '16 10:10 teohhanhui

I can confirm this compilation problem. The referenced (expected) data types have changed between 9.5.x and 9.6.x.

skylerbunny avatar Nov 06 '16 07:11 skylerbunny

https://github.com/funny-falcon/pg_hibernator (a fork) provides this functionality.

skylerbunny avatar Aug 29 '17 02:08 skylerbunny