Skip to content

Commit

Permalink
Merge pull request #10 from petrov9268/master
Browse files Browse the repository at this point in the history
PostgreSQL 15 initial support
  • Loading branch information
deem0n authored Sep 11, 2023
2 parents 44b1a6e + 3cc24e7 commit ec1f854
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 9 additions & 0 deletions redis_fdw--1.0.5--1.0.6.sql
Original file line number Diff line number Diff line change
@@ -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;
13 changes: 13 additions & 0 deletions redis_fdw--1.0.6.sql
Original file line number Diff line number Diff line change
@@ -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;
8 changes: 8 additions & 0 deletions redis_fdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
#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));
Expand Down Expand Up @@ -3440,7 +3444,11 @@ redisAddForeignUpdateTargets(
DefElem *def = (DefElem *)lfirst(option);

if (strcmp(def->defname, OPT_REDIS) == 0) {
#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));
Expand Down
2 changes: 1 addition & 1 deletion redis_fdw.control
Original file line number Diff line number Diff line change
@@ -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

8 changes: 7 additions & 1 deletion rw_redis_fdw.spec
Original file line number Diff line number Diff line change
@@ -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}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ec1f854

Please sign in to comment.