nahanni / rw_redis_fdw

Other
97 stars 23 forks source link

PG12 support changes #15

Closed dumbuzz closed 4 years ago

dumbuzz commented 4 years ago

Changes to redis_fdw.c to compile for PG12:

1) replace all: ExecStoreTuple(tuple, slot, InvalidBuffer, false); with ExecStoreHeapTuple(tuple, slot, false);

watch this commit in alternate FDW: https://github.com/pg-redis-fdw/redis_fdw/commit/ffc73df4e6c8c750b8267369958eba311db8c8cb#diff-1d0ed4f3c8317d86ba27af8e71d692f8

2) add

include "access/heapam.h"

3) replace

include optimizer/var.h

with

include "optimizer/optimizer.h"

ld9999999999 commented 4 years ago

Thanks for pointing this out; I'll need to set up a pg12 environment to test against. However I can also accept a pull request if you are able to do so and have the tests run against pg11 and pg12.

I'm finding all the #if PG_VERSION_NUM unwieldy so this change might be better put as a top level #define... e.g.:

#if PG_VERSION_NUM < 120000
#include optimizer/var.h
#define PGVER_ExecStoreTuple(t,s,b) ExecStoreTuple(t, s, InvalidBuffer, b)
#else
#include "optimizer/optimizer.h"
#define PGVER_ExecStoreTuple(t,s,b) ExecStoreHeapTuple(t, s, b)
#endif
dumbuzz commented 4 years ago

The changes was tested on pg12. Sorry, don't have pg11 environment.

l-d-x commented 4 years ago

Commit 4ffe6038a2a18988b633bfb9203c68dcc717b905 resolves this