Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc67a55d

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 parentc096a80 commitc67a55d

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-
XLogRecPtrlsn;
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)

[8]ページ先頭

©2009-2025 Movatter.jp