nahanni / rw_redis_fdw

Other
97 stars 24 forks source link

PostgreSQL 15 support #20

Open devrimgunduz opened 1 year ago

devrimgunduz commented 1 year ago

Hi,

rw_redis_fdw fails to build against PostgreSQL 15. Can you please take a look? Thanks!

/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-deprecated-non-prototype -O2 -DWRITE_API -g -I. -I./ -I/usr/pgsql-15/include/server -I/usr/pgsql-15/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o redis_fdw.bc redis_fdw.c redis_fdw.c: In function 'redis_fdw_handler': redis_fdw.c:1099:42: warning: assignment to 'AddForeignUpdateTargets_function' {aka 'void ()(PlannerInfo , unsigned int, RangeTblEntry , struct RelationData )'} from incompatible pointer type 'void ()(Query , RangeTblEntry , struct RelationData )' [-Wincompatible-pointer-types] 1099 | routine->AddForeignUpdateTargets = redisAddForeignUpdateTargets; | ^ redis_fdw.c: In function 'get_psql_columns': redis_fdw.c:1353:45: error: 'Value' undeclared (first use in this function) 1353 | colname = ((Value )(def->arg))->val.str; | ^~~~~ redis_fdw.c:1353:45: note: each undeclared identifier is reported only once for each function it appears in redis_fdw.c:1353:52: error: expected expression before ')' token 1353 | colname = ((Value )(def->arg))->val.str; | ^ redis_fdw.c: In function 'redisAddForeignUpdateTargets': redis_fdw.c:3358:45: error: 'Value' undeclared (first use in this function) 3358 | colname = ((Value )(def->arg))->val.str; | ^~~~~ redis_fdw.c:3358:52: error: expected expression before ')' token 3358 | colname = ((Value )(def->arg))->val.str; | ^ redis_fdw.c: In function 'redisBeginForeignModify': redis_fdw.c:3755:40: error: 'ModifyTableState' has no member named 'mt_plans' 3755 | Plan *subplan = mtstate->mt_plans[subplan_index]->plan; | ^~ redis_fdw.c: In function 'redis_parse_where': redis_fdw.c:1843:36: warning: this statement may fall through [-Wimplicit-fallthrough=] 1843 | if (rctx->table_type == PG_REDIS_LIST) { | ^ redis_fdw.c:1848:25: note: here 1848 | default: | ^~~ make[1]: [: redis_fdw.o] Error 1 make[1]: Waiting for unfinished jobs.... redis_fdw.c:1099:35: warning: incompatible function pointer types assigning to 'AddForeignUpdateTargets_function' (aka 'void ()(struct PlannerInfo , unsigned int, struct RangeTblEntry , struct RelationData )') from 'void (Query , RangeTblEntry , Relation)' (aka 'void (struct Query , struct RangeTblEntry , struct RelationData )') [-Wincompatible-function-pointer-types] routine->AddForeignUpdateTargets = redisAddForeignUpdateTargets; ^ ~~~~~~~~ redis_fdw.c:1353:24: error: expected expression colname = ((Value )(def->arg))->val.str; ^ redis_fdw.c:1353:17: error: use of undeclared identifier 'Value' colname = ((Value )(def->arg))->val.str; ^ redis_fdw.c:3358:24: error: expected expression colname = ((Value )(def->arg))->val.str; ^ redis_fdw.c:3358:17: error: use of undeclared identifier 'Value' colname = ((Value )(def->arg))->val.str; ^ redis_fdw.c:3755:28: error: no member named 'mt_plans' in 'struct ModifyTableState' Plan subplan = mtstate->mt_plans[subplan_index]->plan;


1 warning and 5 errors generated.
make[1]: *** [/usr/pgsql-15/lib/pgxs/src/makefiles/../../src/Makefile.global:1080: redis_fdw.bc] Error 1
altair86 commented 1 year ago

Please check my fix https://github.com/altair86/rw_redis_fdw/commit/048c336eb31b2dabe141d7343e6b8e91d0ad9662

devrimgunduz commented 1 year ago

@l-d-x Can you please review this patch and apply if it is good, and then release a new version? Thanks!

devrimgunduz commented 8 months ago

ping.

altair86 commented 8 months ago

ping.

why you ping it?

there is solution: https://github.com/altair86/rw_redis_fdw

I use it on my production system. Welcome

MihaiRaduSandu commented 5 months ago

@altair86 Hello, thank you so much for your update, I installed it and it works. I have a personal question, because documentation is so scarce, how can I read a stream through the connector? I tried with the publish tabletype and a channel but it doesn't return anything. If you could help with some guidance it would highly appreciate it. Thank you, Mihai

altair86 commented 5 months ago

@MihaiRaduSandu Where you trying read a stream?

MihaiRaduSandu commented 5 months ago

Hello @altair86 , yes I am trying to read a stream in Redis. Thank you, Mihai

altair86 commented 5 months ago

@MihaiRaduSandu Hi, Mihai

There is no support for Redis Streams in it Data Wrapper It support only: