MemoryContext cmd_context;
MemoryContext old_context;
- /*
- * Log replication command if log_replication_commands is enabled. Even
- * when it's disabled, log the command with DEBUG1 level for backward
- * compatibility.
- */
- ereport(log_replication_commands ? LOG : DEBUG1,
- (errmsg("received replication command: %s", cmd_string)));
-
/*
* CREATE_REPLICATION_SLOT ... LOGICAL exports a snapshot until the next
* command arrives. Clean up the old stuff if there's anything.
cmd_node = replication_parse_result;
+ /*
+ * Log replication command if log_replication_commands is enabled. Even
+ * when it's disabled, log the command with DEBUG1 level for backward
+ * compatibility. Note that SQL commands are not logged here, and will be
+ * logged later if log_statement is enabled.
+ */
+ if (cmd_node->type != T_SQLCmd)
+ ereport(log_replication_commands ? LOG : DEBUG1,
+ (errmsg("received replication command: %s", cmd_string)));
+
/*
* CREATE_REPLICATION_SLOT ... LOGICAL exports a snapshot. If it was
* called outside of transaction the snapshot should be cleared here.