Document default values for pgoutput options + fix missing initialization for "origin"

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Document default values for pgoutput options + fix missing initialization for "origin"
Date: 2025-05-16 15:06:46
Message-ID: d2790f10-238d-4cb5-a743-d9d2a9dd900f@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

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).

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).

Thoughts?

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

Attachment Content-Type Size
v1-0001-doc-Document-default-values-for-pgoutput-options-.patch text/plain 2.9 KB
v1-0002-pgoutput-Initialize-missing-default-for-origin-pa.patch text/plain 1.5 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2025-05-16 15:40:53 Make wal_receiver_timeout configurable per subscription
Previous Message Maxim Orlov 2025-05-16 14:54:50 Re: Add 64-bit XIDs into PostgreSQL 15