From 82c8b47966cfe83025bfbabe776332ccac050cbb Mon Sep 17 00:00:00 2001 From: Vladislav Nezhutin Date: Wed, 26 Aug 2020 14:05:36 +0600 Subject: [PATCH] pg 13 support --- dockerfile | 1 + pg_json_decoding.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dockerfile b/dockerfile index 0a60313..3786180 100644 --- a/dockerfile +++ b/dockerfile @@ -7,6 +7,7 @@ RUN set -x \ && cd /tmp \ && wget -qO- https://github.com/postgres/postgres/archive/REL_11_4.tar.gz | tar xz \ # && wget -qO- https://github.com/postgres/postgres/archive/REL_12_1.tar.gz | tar xz \ +# && wget -qO- https://github.com/postgres/postgres/archive/REL_13_BETA3.tar.gz | tar xz \ \ && apk add --no-cache --virtual .build-deps \ --repositories-file /dev/null \ diff --git a/pg_json_decoding.c b/pg_json_decoding.c index 382e378..02e37f8 100644 --- a/pg_json_decoding.c +++ b/pg_json_decoding.c @@ -9,6 +9,7 @@ #include "utils/syscache.h" #include "utils/json.h" #include "utils/builtins.h" +#include "utils/array.h" PG_MODULE_MAGIC; @@ -245,7 +246,11 @@ static void pg_decode_message( appendStringInfoString(ctx->out, ",\"prefix\":"); escape_json(ctx->out, prefix); message_b64 = palloc0(pg_b64_enc_len(sz) + 1); - pg_b64_encode(message, sz, message_b64); + pg_b64_encode(message, sz, message_b64 +#if (PG_VERSION_NUM >= 130000) + ,pg_b64_enc_len(sz) + 1 +#endif + ); appendStringInfo(ctx->out, ",\"content\":\"%s\"}", message_b64); pfree(message_b64); MemoryContextSwitchTo(old);