Skip to content

Commit

Permalink
Add macro for backward compatibility
Browse files Browse the repository at this point in the history
UInt64GetDatum was introduced in 9.6. I forgot to test old stable
versions and didn't get it. Fortunately, @df7cb reported it.
  • Loading branch information
Euler Taveira committed Feb 10, 2020
1 parent 84869ea commit 9f97623
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions wal2json.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,19 @@ static void pg_decode_truncate_v2(LogicalDecodingContext *ctx,
ReorderBufferChange *change);
#endif

/*
* Backward compatibility.
*
* This macro is only available in 9.6+.
*/
#if PG_VERSION_NUM < 90600
#ifdef USE_FLOAT8_BYVAL
#define UInt64GetDatum(X) ((Datum) (X))
#else
#define UInt64GetDatum(X) Int64GetDatum((int64) (X))
#endif
#endif

void
_PG_init(void)
{
Expand Down

2 comments on commit 9f97623

@davidfetter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this make another new release?

@df7cb
Copy link

@df7cb df7cb commented on 9f97623 Feb 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fwiw, I can confirm that the Debian package works with 9.5 again. (We don't build 9.4 packages anymore.)
Thanks!

Please sign in to comment.