Skip to content

Commit

Permalink
pg 13 support
Browse files Browse the repository at this point in the history
  • Loading branch information
exe-dealer committed Aug 26, 2020
1 parent 77b3f82 commit 82c8b47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
7 changes: 6 additions & 1 deletion pg_json_decoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "utils/syscache.h"
#include "utils/json.h"
#include "utils/builtins.h"
#include "utils/array.h"

PG_MODULE_MAGIC;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 82c8b47

Please sign in to comment.