Skip to content

Commit 6fdaf3c

Browse files
committed
Fixes for postgres 11.x
1 parent f3db633 commit 6fdaf3c

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

pending.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@
4242
#include "catalog/pg_type.h"
4343
#include "access/xact.h"
4444

45+
#ifndef FALSE
46+
#define FALSE (0)
47+
#endif
48+
49+
#ifndef TRUE
50+
#define TRUE (!FALSE)
51+
#endif
52+
53+
#if PG_VERSION_NUM < 110000
54+
// https://github.com/postgres/postgres/commit/4bd1994650fddf49e717e35f1930d62208845974#diff-350265f4962fd3fb1c5c2d8667d79700
55+
#define DatumGetRangeTypeP DatumGetRangeType
56+
#define RangeTypePGetDatum RangeTypeGetDatum
57+
#endif
58+
4559
PG_MODULE_MAGIC;
4660

4761
enum FieldUsage
@@ -571,7 +585,7 @@ packageData(HeapTuple tTupleData, TupleDesc tTupleDesc, Oid tableOid,
571585
}
572586
} /* KeyUsage!=ALL */
573587

574-
if (tTupleDesc->attrs[iColumnCounter - 1]->attisdropped)
588+
if (TupleDescAttr(tTupleDesc, iColumnCounter - 1)->attisdropped)
575589
{
576590
/**
577591
* This column has been dropped.
@@ -582,8 +596,8 @@ packageData(HeapTuple tTupleData, TupleDesc tTupleDesc, Oid tableOid,
582596

583597
cpFieldName = DatumGetPointer(NameGetDatum
584598

585-
(&tTupleDesc->attrs
586-
[iColumnCounter - 1]->attname));
599+
(&TupleDescAttr(tTupleDesc,
600+
iColumnCounter - 1)->attname));
587601

588602
debug_msg2("dbmirror:packageData field name: %s", cpFieldName);
589603

0 commit comments

Comments
 (0)