Skip to content

Commit c67a55d

Browse files
committed
Make lsn argument of walrcv_create_slot() optional
Some callers are not using it, so it's wasteful to have to specify it. Reviewed-by: Masahiko Sawada <masahiko.sawada@2ndquadrant.com> Discussion: https://www.postgresql.org/message-id/CA+fd4k4BcYrYucNfTnK-CQX3+jsG+PRPEhHAUSo-W4P0Lec57A@mail.gmail.com
1 parent c096a80 commit c67a55d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/backend/commands/subscriptioncmds.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,6 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel)
428428
*/
429429
if (connect)
430430
{
431-
XLogRecPtr lsn;
432431
char *err;
433432
WalReceiverConn *wrconn;
434433
List *tables;
@@ -479,7 +478,7 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel)
479478
Assert(slotname);
480479

481480
walrcv_create_slot(wrconn, slotname, false,
482-
CRS_NOEXPORT_SNAPSHOT, &lsn);
481+
CRS_NOEXPORT_SNAPSHOT, NULL);
483482
ereport(NOTICE,
484483
(errmsg("created replication slot \"%s\" on publisher",
485484
slotname)));

src/backend/replication/libpqwalreceiver/libpqwalreceiver.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,10 @@ libpqrcv_create_slot(WalReceiverConn *conn, const char *slotname,
844844
slotname, pchomp(PQerrorMessage(conn->streamConn)))));
845845
}
846846

847-
*lsn = DatumGetLSN(DirectFunctionCall1Coll(pg_lsn_in, InvalidOid,
848-
CStringGetDatum(PQgetvalue(res, 0, 1))));
847+
if (lsn)
848+
*lsn = DatumGetLSN(DirectFunctionCall1Coll(pg_lsn_in, InvalidOid,
849+
CStringGetDatum(PQgetvalue(res, 0, 1))));
850+
849851
if (!PQgetisnull(res, 0, 2))
850852
snapshot = pstrdup(PQgetvalue(res, 0, 2));
851853
else

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy