From 11942fbb7a2d0bb15d1dafd92b0ff530c6ee0f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=9F=D0=B5?= =?UTF-8?q?=D1=82=D1=80=D0=BE=D0=B2?= Date: Sat, 26 Aug 2023 03:28:04 +0300 Subject: [PATCH 1/5] add PostgeSQL 15 initial compatibility --- redis_fdw.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/redis_fdw.c b/redis_fdw.c index 1f2d2d6..9c4d83b 100644 --- a/redis_fdw.c +++ b/redis_fdw.c @@ -1375,7 +1375,11 @@ get_psql_columns(Oid foreigntableid, struct redis_fdw_ctx *rctx) DefElem *def = (DefElem *)lfirst(option); if (strcmp(def->defname, OPT_REDIS) == 0) { - colname = ((Value *)(def->arg))->val.str; +#if PG_VERSION_NUM < 150000 + colname = ((Value *)(def->arg))->val.str; +#else + colname = ((String *)(def->arg))->sval; +#endif DEBUG((DEBUG_LEVEL, "table %s column remapped (%s) -> (%s)", tablename, NameStr(att_tuple->attname), colname)); @@ -3440,7 +3444,11 @@ redisAddForeignUpdateTargets( DefElem *def = (DefElem *)lfirst(option); if (strcmp(def->defname, OPT_REDIS) == 0) { - colname = ((Value *)(def->arg))->val.str; +#if PG_VERSION_NUM < 150000 + colname = ((Value *)(def->arg))->val.str; +#else + colname = ((String *)(def->arg))->sval; +#endif DEBUG((DEBUG_LEVEL, "column remapped (%s) -> (%s)", NameStr(att->attname), colname)); From 0b8177f54407b6e13ace5f191803c13c934e5f33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=9F=D0=B5?= =?UTF-8?q?=D1=82=D1=80=D0=BE=D0=B2?= Date: Sat, 26 Aug 2023 03:28:54 +0300 Subject: [PATCH 2/5] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index da8e259..fb5d0fc 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This project is currently work in progress and may have experience significant c **PostgreSQL version compatibility** -Currently tested against PostgreSQL 9.4+, 10, 11, 12, 13 and 14. Other versions might work but unconfirmed. +Currently tested against PostgreSQL 9.4+, 10, 11, 12, 13, 14 and 15. Other versions might work but unconfirmed. ## Building ### Dependencies: From cf03453f2b9ae10488108969a25f820bd4cccf4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=9F=D0=B5?= =?UTF-8?q?=D1=82=D1=80=D0=BE=D0=B2?= Date: Sat, 26 Aug 2023 03:30:00 +0300 Subject: [PATCH 3/5] bump extension version --- redis_fdw--1.0.5--1.0.6.sql | 9 +++++++++ redis_fdw--1.0.6.sql | 13 +++++++++++++ redis_fdw.control | 2 +- rw_redis_fdw.spec | 2 +- 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 redis_fdw--1.0.5--1.0.6.sql create mode 100644 redis_fdw--1.0.6.sql diff --git a/redis_fdw--1.0.5--1.0.6.sql b/redis_fdw--1.0.5--1.0.6.sql new file mode 100644 index 0000000..1d8874c --- /dev/null +++ b/redis_fdw--1.0.5--1.0.6.sql @@ -0,0 +1,9 @@ +CREATE OR REPLACE FUNCTION redis_fdw_handler() + RETURNS fdw_handler + AS 'MODULE_PATHNAME' + LANGUAGE C STRICT; + +CREATE OR REPLACE FUNCTION redis_fdw_validator(text[], oid) + RETURNS void + AS 'MODULE_PATHNAME' + LANGUAGE C STRICT; diff --git a/redis_fdw--1.0.6.sql b/redis_fdw--1.0.6.sql new file mode 100644 index 0000000..36789d2 --- /dev/null +++ b/redis_fdw--1.0.6.sql @@ -0,0 +1,13 @@ +CREATE FUNCTION redis_fdw_handler() + RETURNS fdw_handler + AS 'MODULE_PATHNAME' + LANGUAGE C STRICT; + +CREATE FUNCTION redis_fdw_validator(text[], oid) + RETURNS void + AS 'MODULE_PATHNAME' + LANGUAGE C STRICT; + +CREATE FOREIGN DATA WRAPPER redis_fdw + HANDLER redis_fdw_handler + VALIDATOR redis_fdw_validator; diff --git a/redis_fdw.control b/redis_fdw.control index 3bcf8e1..d8b485f 100644 --- a/redis_fdw.control +++ b/redis_fdw.control @@ -1,5 +1,5 @@ comment = 'foreign-data wrapper for Redis' -default_version = '1.0.5' +default_version = '1.0.6' module_pathname = '$libdir/redis_fdw' relocatable = true diff --git a/rw_redis_fdw.spec b/rw_redis_fdw.spec index acd1281..fa673b0 100644 --- a/rw_redis_fdw.spec +++ b/rw_redis_fdw.spec @@ -1,4 +1,4 @@ -%define redis_fdw_ver 1.0.5 +%define redis_fdw_ver 1.0.6 %define postgresql_ver 11 Summary: Redis FDW for PostgreSQL %{postgresql_ver} From c59d7c9302344f84b4f4714d90b10f1252f83788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=9F=D0=B5?= =?UTF-8?q?=D1=82=D1=80=D0=BE=D0=B2?= Date: Sat, 26 Aug 2023 03:30:40 +0300 Subject: [PATCH 4/5] update changelogs and add missing entries --- CHANGES | 8 ++++++++ rw_redis_fdw.spec | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGES b/CHANGES index 8937183..37e5442 100644 --- a/CHANGES +++ b/CHANGES @@ -11,3 +11,11 @@ 2022-08-29 Version 1.0.4 - Removed %jd from all format strings, using %lld everywhere for 64 bit integers + +2022-12-07 Version 1.0.5 + +- PostgreSQL 14 support + +2023-08-26 Version 1.0.6 + +- PostrgeSQL 15 support diff --git a/rw_redis_fdw.spec b/rw_redis_fdw.spec index fa673b0..1867a59 100644 --- a/rw_redis_fdw.spec +++ b/rw_redis_fdw.spec @@ -45,6 +45,12 @@ export PATH=/usr/pgsql-%{postgresql_ver}/bin:$PATH %{_prefix}/pgsql-11/share/extension/redis_fdw.control %changelog +* Sat Aug 26 2023 p +- PostreSQL 15 support +* Wed Dec 07 2022 Andrei Chistyakov +- PostreSQL 14 support +* Mon Aug 29 2022 Dmitri Dorofeev +- Removed %jd from all format strings, using %lld everywhere for 64 bit integers * Thu Feb 11 2021 Dmitri Dorofeev - Fix redisCommand() format string, it does not support %jd, so we are using %ld * Thu Jul 16 2020 Andrei Surgutanov From 3cc24e7f4a3ecd0b8579f5291b624d0496590e41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=9F=D0=B5?= =?UTF-8?q?=D1=82=D1=80=D0=BE=D0=B2?= Date: Sat, 26 Aug 2023 04:10:45 +0300 Subject: [PATCH 5/5] fix formatting --- redis_fdw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/redis_fdw.c b/redis_fdw.c index 9c4d83b..2bf23ce 100644 --- a/redis_fdw.c +++ b/redis_fdw.c @@ -1376,9 +1376,9 @@ get_psql_columns(Oid foreigntableid, struct redis_fdw_ctx *rctx) if (strcmp(def->defname, OPT_REDIS) == 0) { #if PG_VERSION_NUM < 150000 - colname = ((Value *)(def->arg))->val.str; + colname = ((Value *)(def->arg))->val.str; #else - colname = ((String *)(def->arg))->sval; + colname = ((String *)(def->arg))->sval; #endif DEBUG((DEBUG_LEVEL, "table %s column remapped (%s) -> (%s)", @@ -3445,9 +3445,9 @@ redisAddForeignUpdateTargets( if (strcmp(def->defname, OPT_REDIS) == 0) { #if PG_VERSION_NUM < 150000 - colname = ((Value *)(def->arg))->val.str; + colname = ((Value *)(def->arg))->val.str; #else - colname = ((String *)(def->arg))->sval; + colname = ((String *)(def->arg))->sval; #endif DEBUG((DEBUG_LEVEL, "column remapped (%s) -> (%s)",