mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
Introduce macros determining if a replication slot is physical or logical.
These make the code a bit easier to read, and make it easier to add a more explicit notion of a slot's type at some point in the future. Author: Gurjeet Singh Discussion: CABwTF4Wh_dBCzTU=49pFXR6coR4NW1ynb+vBqT+Po=7fuq5iCw@mail.gmail.com
This commit is contained in:
@@ -514,7 +514,7 @@ StartReplication(StartReplicationCmd *cmd)
|
||||
if (cmd->slotname)
|
||||
{
|
||||
ReplicationSlotAcquire(cmd->slotname);
|
||||
if (MyReplicationSlot->data.database != InvalidOid)
|
||||
if (SlotIsLogical(MyReplicationSlot))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
||||
(errmsg("cannot use a logical replication slot for physical replication"))));
|
||||
@@ -1564,7 +1564,7 @@ ProcessStandbyReplyMessage(void)
|
||||
*/
|
||||
if (MyReplicationSlot && flushPtr != InvalidXLogRecPtr)
|
||||
{
|
||||
if (MyReplicationSlot->data.database != InvalidOid)
|
||||
if (SlotIsLogical(MyReplicationSlot))
|
||||
LogicalConfirmReceivedLocation(flushPtr);
|
||||
else
|
||||
PhysicalConfirmReceivedLocation(flushPtr);
|
||||
|
Reference in New Issue
Block a user