Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uHCum-00FR8Q-Sr for pgsql-hackers@arkaria.postgresql.org; Tue, 20 May 2025 02:41:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uHCuk-003D8I-Qt for pgsql-hackers@arkaria.postgresql.org; Tue, 20 May 2025 02:41:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uHCuj-003D8A-T3 for pgsql-hackers@lists.postgresql.org; Tue, 20 May 2025 02:41:10 +0000 Received: from fout-b7-smtp.messagingengine.com ([202.12.124.150]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uHCue-002gFt-0v for pgsql-hackers@lists.postgresql.org; Tue, 20 May 2025 02:41:09 +0000 Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfout.stl.internal (Postfix) with ESMTP id 3778C1140164; Mon, 19 May 2025 22:41:03 -0400 (EDT) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-07.internal (MEProxy); Mon, 19 May 2025 22:41:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1747708863; x=1747795263; bh=ieUc/gZ6mk 2YUdovcy7l2//IoLWmtEPC2lNNPvT2w78=; b=WyBd/wN3O9sCeWuzjeFQuWt89c EeEVEAPgYYWKL0DDekbvLpktbrrzcVJTKsKqvMYvnCrexiZmhEPy1oDLHu/Mo2U7 Uw4KggCHJ6ToSt1L3BoBRTx6zdwYzF9yegzoxQKzwYW7zPJ1ga27B22dgABvKuN1 0zTScqnISkIX7Qf02dd6hZEz7qATV489YqpJz3K5HEzY7Lgo4YZLDjm9qTVoKWPt Twt8kaNP/HWb4++L9ke3Vcp+bC9C/AyF4wZjJHY4eGyfFohZrh2sakZP4OcaH8Kx OChepQhHkCKSYY9x0xZc1cERlDGOlIVN4LP2laPixZCKmu8QvyzhA13xqmCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1747708863; x=1747795263; bh=ieUc/gZ6mk2YUdovcy7l2//IoLWmtEPC2lN NPvT2w78=; b=KVkfqhGg79mTcMsn6nt9nPtdbg8zf91hdy9IRLfPju8bYB27xLi UW8pzfhRdKXA6E/A5UoKUp2hNkrQpH5hJ4shg3NeUoLAtD3lOj4WvtXkWQGmfY/K N++OohIOvMHccPImNWwiWrDtChbLz1zOywmm7pY/Vbo7IUp4+BmHqTdjwIQRqWX/ clLMJbX9nnJ1NzL1r5rTA9QldCLCKIyoQFYWNInBL2IaJocghMUzCyDxsn1EwYt5 dYt9PIN3x4oNHP09kmj20g1wP7sBuGb3YyaQEx0dBrmWL+EWpQTFzSMB2lykiN/Q r67Jml5NEN35JQbkNK5sybQaOtLGgAw0Uog== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdefvdeftdekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefogg ffhffvvefkjghfufgtsegrtderreertddtnecuhfhrohhmpedfgfhulhgvrhcuvfgrvhgv ihhrrgdfuceovghulhgvrhesvghulhgvrhhtohdrtghomheqnecuggftrfgrthhtvghrnh epgfefvdelheevudfffefhheduhffflefhvdekgefgheevffdttefhvdelueeiteeunecu ffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghdpvghnthgvrhhprhhishgvuggsrd gtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep vghulhgvrhesvghulhgvrhhtohdrtghomhdpnhgspghrtghpthhtohepvddpmhhouggvpe hsmhhtphhouhhtpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdr phhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepmhgrshgrohdrfhhujhhiihesoh hsshdrnhhtthgurghtrgdrtghomh X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 6A68B302005F; Mon, 19 May 2025 22:41:01 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: Tce78c6cebf664b57 Date: Mon, 19 May 2025 23:40:40 -0300 From: "Euler Taveira" To: pgsql-hackers@lists.postgresql.org Cc: masao.fujii@oss.nttdata.com Message-Id: <8d21fb98-5c25-4dee-8387-e5a62b01ea7d@app.fastmail.com> In-Reply-To: References: Subject: Re: Document default values for pgoutput options + fix missing initialization for "origin" Content-Type: multipart/alternative; boundary=ea86e643a0314be7ac7dc88be1800504 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ea86e643a0314be7ac7dc88be1800504 Content-Type: text/plain Content-Transfer-Encoding: 7bit On Fri, May 16, 2025, at 12:06 PM, Fujii Masao wrote: > The pgoutput plugin options are documented in the logical streaming > replication protocol, but their default values are not mentioned. > This can be inconvenient for users - for example, when using pg_recvlogical > with pgoutput plugin and needing to know the default behavior of each option. > https://www.postgresql.org/docs/devel/protocol-logical-replication.html > > I'd like to propose adding the default values to the documentation to > improve clarity and usability. Patch attached (0001 patch). Good catch. Should we use "on" and "off" as other enum GUCs (wal_compression, recovery_prefetch, compute_query_id)? The current convention is to support other ways (true / false / 1 / 0) to write boolean but only document one way (on / off). Since you are changing this page, I would like to suggest removing "Boolean" from streaming option. It is not a boolean anymore since protocol version 4. The suggested description is: + Option to enable streaming of in-progress transactions. Valid values are + off (the default), on and + parallel. The setting parallel + enables sending extra information with some messages to be used for + parallelization. Minimum protocol version 2 is required to turn it + on. Minimum protocol version 4 is required for the + parallel value. > While working on this, I also noticed that although most optional parameters > (like "binary") are explicitly initialized in parse_output_parameters(), > the "origin" parameter is not. Its value (PGOutputData->publish_no_origin) > is implicitly set to false due to zero-initialization, but unlike other > parameters, it lacks an explicit default assignment. > > To ensure consistency and make the behavior clearer, I propose explicitly > initializing the "origin" parameter as well. A patch for this is also attached > (0002 patch). LGTM. It seems an oversight from the original commit 366283961ac0. -- Euler Taveira EDB https://www.enterprisedb.com/ --ea86e643a0314be7ac7dc88be1800504 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Fri, May = 16, 2025, at 12:06 PM, Fujii Masao wrote:
The pgoutput plugin options are documented in= the logical streaming
replication protocol, but their default= values are not mentioned.
This can be inconvenient for users = - for example, when using pg_recvlogical
with pgoutput plugin = and needing to know the default behavior of each option.

I'd like to propose adding the defau= lt values to the documentation to
improve clarity and usabilit= y. Patch attached (0001 patch).

Go= od catch.

Should we use "on" and "off" as other= enum GUCs (wal_compression,
recovery_prefetch, compute_query_= id)? The current convention is to support
other ways (true / f= alse / 1 / 0) to write boolean but only document one way
(on /= off).

Since you are changing this page, I woul= d like to suggest removing "Boolean"
from streaming option. It= is not a boolean anymore since protocol version 4.
The sugges= ted description is:

+    &n= bsp;  Option to enable streaming of in-progress transactions. Valid= values are
+       <literal&= gt;off</literal> (the default), <literal>on</literal> = and
+       <literal>paral= lel</literal>. The setting <literal>parallel</literal>=
+       enables sending extra i= nformation with some messages to be used for
+  &nbs= p;    parallelization. Minimum protocol version 2 is requ= ired to turn it
+       <lite= ral>on</literal>.  Minimum protocol version 4 is required = for the
+       <literal>p= arallel</literal> value.


While working on this, I a= lso noticed that although most optional parameters
(like "bina= ry") are explicitly initialized in parse_output_parameters(),
= the "origin" parameter is not. Its value (PGOutputData->publish_no_or= igin)
is implicitly set to false due to zero-initialization, b= ut unlike other
parameters, it lacks an explicit default assig= nment.

To ensure consistency and make the behav= ior clearer, I propose explicitly
initializing the "origin" pa= rameter as well. A patch for this is also attached
(0002 patch= ).

LGTM. It seems an oversight fro= m the original commit 366283961ac0.


<= div id=3D"sig112409080">
--
Euler Taveira
EDB   https://www.enterprisedb.com/

--ea86e643a0314be7ac7dc88be1800504--