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

Commitc8bc807

Browse files
author
Amit Kapila
committed
pgoutput: Raise an error for missing protocol version parameter.
Currently, we give a misleading error if the user omits to pass therequired parameter 'proto_version' in SQL APIpg_logical_slot_get_changes() or during START_REPLICATION protocolmessage. The error raised is as follows which indicates that the wrongversion is passed.ERROR: client sent proto_version=0 but server only supports protocol 1 or higherAuthor: Emre HasegeliReviewed-by: Peter Smith, Amit KapilaDiscussion:https://postgr.es/m/CAE2gYzwdwtUbs-tPSV-QBwgTubiyGD2ZGsSnAVsDfAGGLDrGOA@mail.gmail.com
1 parent8b965c5 commitc8bc807

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

‎src/backend/replication/pgoutput/pgoutput.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,16 @@ parse_output_parameters(List *options, PGOutputData *data)
400400
else
401401
elog(ERROR,"unrecognized pgoutput option: %s",defel->defname);
402402
}
403+
404+
/* Check required options */
405+
if (!protocol_version_given)
406+
ereport(ERROR,
407+
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
408+
errmsg("proto_version option missing"));
409+
if (!publication_names_given)
410+
ereport(ERROR,
411+
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
412+
errmsg("publication_names option missing"));
403413
}
404414

405415
/*
@@ -449,11 +459,6 @@ pgoutput_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
449459
errmsg("client sent proto_version=%d but server only supports protocol %d or higher",
450460
data->protocol_version,LOGICALREP_PROTO_MIN_VERSION_NUM)));
451461

452-
if (data->publication_names==NIL)
453-
ereport(ERROR,
454-
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
455-
errmsg("publication_names parameter missing")));
456-
457462
/*
458463
* Decide whether to enable streaming. It is disabled by default, in
459464
* which case we just update the flag in decoding context. Otherwise

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp