ReplicationSlotCreate(cmd->slotname, false,
cmd->temporary ? RS_TEMPORARY : RS_PERSISTENT,
false);
+
+ if (reserve_wal)
+ {
+ ReplicationSlotReserveWal();
+
+ ReplicationSlotMarkDirty();
+
+ /* Write this slot to disk if it's a permanent one. */
+ if (!cmd->temporary)
+ ReplicationSlotSave();
+ }
}
else
{
+ LogicalDecodingContext *ctx;
+ bool need_full_snapshot = false;
+
+ Assert(cmd->kind == REPLICATION_KIND_LOGICAL);
+
CheckLogicalDecodingRequirements();
/*
ReplicationSlotCreate(cmd->slotname, true,
cmd->temporary ? RS_TEMPORARY : RS_EPHEMERAL,
two_phase);
- }
-
- if (cmd->kind == REPLICATION_KIND_LOGICAL)
- {
- LogicalDecodingContext *ctx;
- bool need_full_snapshot = false;
/*
* Do options check early so that we can bail before calling the
if (!cmd->temporary)
ReplicationSlotPersist();
}
- else if (cmd->kind == REPLICATION_KIND_PHYSICAL && reserve_wal)
- {
- ReplicationSlotReserveWal();
-
- ReplicationSlotMarkDirty();
-
- /* Write this slot to disk if it's a permanent one. */
- if (!cmd->temporary)
- ReplicationSlotSave();
- }
snprintf(xloc, sizeof(xloc), "%X/%X",
LSN_FORMAT_ARGS(MyReplicationSlot->data.confirmed_flush));