COMMIT callback */
| 318 | |
| 319 | /* COMMIT callback */ |
| 320 | static void |
| 321 | pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, |
| 322 | XLogRecPtr commit_lsn) |
| 323 | { |
| 324 | TestDecodingData *data = ctx->output_plugin_private; |
| 325 | TestDecodingTxnData *txndata = txn->output_plugin_private; |
| 326 | bool xact_wrote_changes = txndata->xact_wrote_changes; |
| 327 | |
| 328 | pfree(txndata); |
| 329 | txn->output_plugin_private = NULL; |
| 330 | |
| 331 | if (data->skip_empty_xacts && !xact_wrote_changes) |
| 332 | return; |
| 333 | |
| 334 | OutputPluginPrepareWrite(ctx, true); |
| 335 | if (data->include_xids) |
| 336 | appendStringInfo(ctx->out, "COMMIT %u", txn->xid); |
| 337 | else |
| 338 | appendStringInfoString(ctx->out, "COMMIT"); |
| 339 | |
| 340 | if (data->include_timestamp) |
| 341 | appendStringInfo(ctx->out, " (at %s)", |
| 342 | timestamptz_to_str(txn->commit_time)); |
| 343 | |
| 344 | OutputPluginWrite(ctx, true); |
| 345 | } |
| 346 | |
| 347 | /* BEGIN PREPARE callback */ |
| 348 | static void |
nothing calls this directly
no test coverage detected