Skip to content

Commit

Permalink
Fixes for postgres 11.x
Browse files Browse the repository at this point in the history
  • Loading branch information
mwiencek committed Dec 12, 2019
1 parent f3db633 commit 6fdaf3c
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions pending.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@
#include "catalog/pg_type.h"
#include "access/xact.h"

#ifndef FALSE
#define FALSE (0)
#endif

#ifndef TRUE
#define TRUE (!FALSE)
#endif

#if PG_VERSION_NUM < 110000
// https://github.com/postgres/postgres/commit/4bd1994650fddf49e717e35f1930d62208845974#diff-350265f4962fd3fb1c5c2d8667d79700
#define DatumGetRangeTypeP DatumGetRangeType
#define RangeTypePGetDatum RangeTypeGetDatum
#endif

PG_MODULE_MAGIC;

enum FieldUsage
Expand Down Expand Up @@ -571,7 +585,7 @@ packageData(HeapTuple tTupleData, TupleDesc tTupleDesc, Oid tableOid,
}
} /* KeyUsage!=ALL */

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

cpFieldName = DatumGetPointer(NameGetDatum

(&tTupleDesc->attrs
[iColumnCounter - 1]->attname));
(&TupleDescAttr(tTupleDesc,
iColumnCounter - 1)->attname));

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

Expand Down

0 comments on commit 6fdaf3c

Please sign in to comment.