1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +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:
Andres Freund
2015-08-11 12:32:48 +02:00
parent 3b425b7c02
commit 093d0c83c1
4 changed files with 10 additions and 7 deletions

View File

@@ -693,7 +693,7 @@ ReplicationSlotsComputeLogicalRestartLSN(void)
continue;
/* we're only interested in logical slots */
if (s->data.database == InvalidOid)
if (!SlotIsLogical(s))
continue;
/* read once, it's ok if it increases while we're checking */
@@ -740,8 +740,8 @@ ReplicationSlotsCountDBSlots(Oid dboid, int *nslots, int *nactive)
if (!s->in_use)
continue;
/* not database specific, skip */
if (s->data.database == InvalidOid)
/* only logical slots are database specific, skip */
if (!SlotIsLogical(s))
continue;
/* not our database, skip */