aboutsummaryrefslogtreecommitdiff
path: root/src/backend/replication/logical/tablesync.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/replication/logical/tablesync.c')
-rw-r--r--src/backend/replication/logical/tablesync.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/replication/logical/tablesync.c b/src/backend/replication/logical/tablesync.c
index bf276410099..d287e95df1d 100644
--- a/src/backend/replication/logical/tablesync.c
+++ b/src/backend/replication/logical/tablesync.c
@@ -114,9 +114,15 @@ StringInfo copybuf = NULL;
static void pg_attribute_noreturn()
finish_sync_worker(void)
{
- /* Commit any outstanding transaction. */
+ /*
+ * Commit any outstanding transaction. This is the usual case, unless
+ * there was nothing to do for the table.
+ */
if (IsTransactionState())
+ {
CommitTransactionCommand();
+ pgstat_report_stat(false);
+ }
/* And flush all writes. */
XLogFlush(GetXLogWriteRecPtr());