aboutsummaryrefslogtreecommitdiff
path: root/src/backend/replication/logical/logical.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2015-08-11 12:32:48 +0200
committerAndres Freund <andres@anarazel.de>2015-08-11 12:32:48 +0200
commit093d0c83c1d210167d122da92459a0677e04ffc9 (patch)
tree11784342960a18a5c75bad85a864adca143513e8 /src/backend/replication/logical/logical.c
parent3b425b7c02ccdabe3fb3a538d9174273a15f1e2e (diff)
downloadpostgresql-093d0c83c1d210167d122da92459a0677e04ffc9.tar.gz
postgresql-093d0c83c1d210167d122da92459a0677e04ffc9.zip
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
Diffstat (limited to 'src/backend/replication/logical/logical.c')
-rw-r--r--src/backend/replication/logical/logical.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/replication/logical/logical.c b/src/backend/replication/logical/logical.c
index ee7d3268f02..5411e599eb2 100644
--- a/src/backend/replication/logical/logical.c
+++ b/src/backend/replication/logical/logical.c
@@ -228,7 +228,7 @@ CreateInitDecodingContext(char *plugin,
elog(ERROR, "cannot initialize logical decoding without a specified plugin");
/* Make sure the passed slot is suitable. These are user facing errors. */
- if (slot->data.database == InvalidOid)
+ if (SlotIsPhysical(slot))
ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("cannot use physical replication slot for logical decoding")));
@@ -377,7 +377,7 @@ CreateDecodingContext(XLogRecPtr start_lsn,
elog(ERROR, "cannot perform logical decoding without an acquired slot");
/* make sure the passed slot is suitable, these are user facing errors */
- if (slot->data.database == InvalidOid)
+ if (SlotIsPhysical(slot))
ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
(errmsg("cannot use physical replication slot for logical decoding"))));