@@ -119,9 +119,14 @@ static void pg_decode_startup(LogicalDecodingContext *ctx,
119
119
elog (DEBUG1 , "Entering startup callback" );
120
120
121
121
data = palloc (sizeof (DecoderData ));
122
+ #if PG_VERSION_NUM >= 90600
123
+ data -> context = AllocSetContextCreate (
124
+ ctx -> context , "decoderbufs context" , ALLOCSET_DEFAULT_SIZES );
125
+ #else
122
126
data -> context = AllocSetContextCreate (
123
127
ctx -> context , "decoderbufs context" , ALLOCSET_DEFAULT_MINSIZE ,
124
128
ALLOCSET_DEFAULT_INITSIZE , ALLOCSET_DEFAULT_MAXSIZE );
129
+ #endif
125
130
data -> debug_mode = false;
126
131
opt -> output_type = OUTPUT_PLUGIN_BINARY_OUTPUT ;
127
132
@@ -478,7 +483,7 @@ static int valid_attributes_count_from(TupleDesc tupdesc) {
478
483
int natt ;
479
484
int count = 0 ;
480
485
for (natt = 0 ; natt < tupdesc -> natts ; natt ++ ) {
481
- Form_pg_attribute attr = tupdesc -> attrs [ natt ] ;
486
+ Form_pg_attribute attr = TupleDescAttr ( tupdesc , natt ) ;
482
487
483
488
/* skip dropped columns and system columns */
484
489
if (attr -> attisdropped || attr -> attnum < 0 ) {
@@ -506,7 +511,7 @@ static void tuple_to_tuple_msg(Decoderbufs__DatumMessage **tmsg,
506
511
bool typisvarlena ;
507
512
Decoderbufs__DatumMessage datum_msg = DECODERBUFS__DATUM_MESSAGE__INIT ;
508
513
509
- attr = tupdesc -> attrs [ natt ] ;
514
+ attr = TupleDescAttr ( tupdesc , natt ) ;
510
515
511
516
/* skip dropped columns and system columns */
512
517
if (attr -> attisdropped || attr -> attnum < 0 ) {
@@ -564,7 +569,7 @@ static void add_metadata_to_msg(Decoderbufs__TypeInfo **tmsg,
564
569
Decoderbufs__TypeInfo typeinfo = DECODERBUFS__TYPE_INFO__INIT ;
565
570
bool not_null ;
566
571
567
- attr = tupdesc -> attrs [ natt ] ;
572
+ attr = TupleDescAttr ( tupdesc , natt ) ;
568
573
569
574
/* skip dropped columns and system columns */
570
575
if (attr -> attisdropped || attr -> attnum < 0 ) {
0 commit comments