12
12
*/
13
13
#include "postgres.h"
14
14
15
- #include "pglogical_output/compat.h"
16
15
#include "pglogical_config.h"
17
16
#include "pglogical_output.h"
18
17
#include "pglogical_proto.h"
34
33
35
34
#include "replication/output_plugin.h"
36
35
#include "replication/logical.h"
37
- #ifdef HAVE_REPLICATION_ORIGINS
38
36
#include "replication/origin.h"
39
- #endif
40
37
41
38
#include "utils/builtins.h"
42
39
#include "utils/catcache.h"
@@ -66,10 +63,8 @@ static void pg_decode_change(LogicalDecodingContext *ctx,
66
63
ReorderBufferTXN * txn , Relation rel ,
67
64
ReorderBufferChange * change );
68
65
69
- #ifdef HAVE_REPLICATION_ORIGINS
70
66
static bool pg_decode_origin_filter (LogicalDecodingContext * ctx ,
71
67
RepOriginId origin_id );
72
- #endif
73
68
74
69
static void send_startup_message (LogicalDecodingContext * ctx ,
75
70
PGLogicalOutputData * data , bool last_message );
@@ -86,9 +81,7 @@ _PG_output_plugin_init(OutputPluginCallbacks *cb)
86
81
cb -> begin_cb = pg_decode_begin_txn ;
87
82
cb -> change_cb = pg_decode_change ;
88
83
cb -> commit_cb = pg_decode_commit_txn ;
89
- #ifdef HAVE_REPLICATION_ORIGINS
90
84
cb -> filter_by_origin_cb = pg_decode_origin_filter ;
91
- #endif
92
85
cb -> shutdown_cb = pg_decode_shutdown ;
93
86
}
94
87
@@ -379,15 +372,12 @@ pg_decode_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
379
372
if (!startup_message_sent )
380
373
send_startup_message (ctx , data , false /* can't be last message */ );
381
374
382
- #ifdef HAVE_REPLICATION_ORIGINS
383
375
/* If the record didn't originate locally, send origin info */
384
376
send_replication_origin &= txn -> origin_id != InvalidRepOriginId ;
385
- #endif
386
377
387
378
OutputPluginPrepareWrite (ctx , !send_replication_origin );
388
379
data -> api -> write_begin (ctx -> out , data , txn );
389
380
390
- #ifdef HAVE_REPLICATION_ORIGINS
391
381
if (send_replication_origin )
392
382
{
393
383
char * origin ;
@@ -409,7 +399,6 @@ pg_decode_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
409
399
replorigin_by_oid (txn -> origin_id , true, & origin ))
410
400
data -> api -> write_origin (ctx -> out , origin , txn -> origin_lsn );
411
401
}
412
- #endif
413
402
414
403
OutputPluginWrite (ctx , true);
415
404
}
@@ -490,7 +479,6 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
490
479
MemoryContextReset (data -> context );
491
480
}
492
481
493
- #ifdef HAVE_REPLICATION_ORIGINS
494
482
/*
495
483
* Decide if the whole transaction with specific origin should be filtered out.
496
484
*/
@@ -508,7 +496,6 @@ pg_decode_origin_filter(LogicalDecodingContext *ctx,
508
496
509
497
return false;
510
498
}
511
- #endif
512
499
513
500
static void
514
501
send_startup_message (LogicalDecodingContext * ctx ,
0 commit comments