Re: pg_recvlogical requires -d but not described on the documentation - Mailing list pgsql-hackers

From vignesh C
Subject Re: pg_recvlogical requires -d but not described on the documentation
Date
Msg-id CALDaNm3KdAim6-2Wf9oqjebBdCbuaUPHhbUGMRexkpk-h6k2WQ@mail.gmail.com
Whole thread Raw
In response to RE: pg_recvlogical requires -d but not described on the documentation  ("Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>)
Responses Re: pg_recvlogical requires -d but not described on the documentation
List pgsql-hackers
On Fri, 21 Feb 2025 at 14:25, Hayato Kuroda (Fujitsu)
<kuroda.hayato@fujitsu.com> wrote:
>
> Dear Ashutosh,
>
> Thanks for the reply.
>
> > > ISTM the inconsistency is introduced since the initial commit. I think they should
> > be unified either
> > > 1) update the doc or 2) accept when -d is not specified. Personally, I like 2nd
> > approach, pg_recvlogical
> > > can follow the normal connection rule. I.e.,
> > >
> >
> > Given that the discrepancy has survived so long, it seems that users
> > always pass -d. And to some extent, requiring users to specify a
> > database instead of defaulting to one is safer practice. This avoids
> > users fetching changes from unexpected database/slot and cause further
> > database inconsistencies on the receiver side. I would just fix
> > documentation in this case.
>
> Something like attached, right?

Apart from the database, I believe the target file also needs to be
specified. Should we include this option also along with dbname:
+   <group choice="plain">
+    <group choice="req">
+     <arg choice="plain"><option>-d</option></arg>
+     <arg choice="plain"><option>--dbname</option></arg>
+    </group>
+    <replaceable>dbname</replaceable>
+   </group>

pg_recvlogical -U postgres --start -S test -d postgres
pg_recvlogical: error: no target file specified

Regards,
Vignesh



pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Documentation Edits for pg_createsubscriber
Next
From: Bertrand Drouvot
Date:
Subject: Re: per backend WAL statistics