pgoutput: Initialize missing default for "origin" parameter.
authorFujii Masao <fujii@postgresql.org>
Wed, 16 Jul 2025 01:31:51 +0000 (10:31 +0900)
committerFujii Masao <fujii@postgresql.org>
Wed, 16 Jul 2025 01:31:51 +0000 (10:31 +0900)
The pgoutput plugin initializes optional parameters like "binary" with
default values at the start of processing. However, the "origin"
parameter was previously missed and left without explicit initialization.

Although the PGOutputData struct, which holds these settings,
is zero-initialized at allocation (resulting in publish_no_origin field
for "origin" parameter being false by default), this default was not
set explicitly, unlike other parameters.

This commit adds explicit initialization of the "origin" parameter to
ensure consistency and clarity in how defaults are handled.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Euler Taveira <euler@eulerto.com>
Discussion: http://postgr.es/m/d2790f10-238d-4cb5-a743-d9d2a9dd900f@oss.nttdata.com

src/backend/replication/pgoutput/pgoutput.c

index 082b4d9d32798a987d6a14c7a12af642b59aea74..f4c977262c5a4a2d6455f93ee04f6f8991b492f3 100644 (file)
@@ -297,10 +297,12 @@ parse_output_parameters(List *options, PGOutputData *data)
    bool        two_phase_option_given = false;
    bool        origin_option_given = false;
 
+   /* Initialize optional parameters to defaults */
    data->binary = false;
    data->streaming = LOGICALREP_STREAM_OFF;
    data->messages = false;
    data->two_phase = false;
+   data->publish_no_origin = false;
 
    foreach(lc, options)
    {