Re: Doc: CREATE_REPLICATION_SLOT command requires the plugin name - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Doc: CREATE_REPLICATION_SLOT command requires the plugin name
Date
Msg-id CAA4eK1+sKiibJ9EbTw+Bv8c+E0eEkNOxwHeFU-+203MrMDaySg@mail.gmail.com
Whole thread Raw
In response to Re: Doc: CREATE_REPLICATION_SLOT command requires the plugin name  (Antonin Houska <ah@cybertec.at>)
List pgsql-hackers
On Wed, Feb 2, 2022 at 12:41 PM Antonin Houska <ah@cybertec.at> wrote:
>
> Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> > On Tue, Feb 1, 2022 at 5:43 PM Antonin Houska <ah@cybertec.at> wrote:
> > >
> > > Amit Kapila <amit.kapila16@gmail.com> wrote:
> > >
> > > > On Tue, Feb 1, 2022 at 3:44 PM Antonin Houska <ah@cybertec.at> wrote:
> > > > >
> > > > > I got a syntax error when using the command according to the existing
> > > > > documentation. The output_plugin parameter needs to be passed too.
> > > > >
> > > >
> > > > Why do we need it for physical slots?
> > >
> > > Sure we don't, the missing curly brackets seem to be the problem. I used the
> > > other form of the command for reference, which therefore might need a minor
> > > fix too.
> > >
> >
> > Instead of adding additional '{}', can't we simply use:
> > { <literal>PHYSICAL</literal> [ <literal>RESERVE_WAL</literal> ] |
> > <literal>LOGICAL</literal> <replaceable
> > class="parameter">output_plugin</replaceable> } [
> > <literal>EXPORT_SNAPSHOT</literal> |
> > <literal>NOEXPORT_SNAPSHOT</literal> | <literal>USE_SNAPSHOT</literal>
> > | <literal>TWO_PHASE</literal> ]
>
> Do you mean changing
>
> CREATE_REPLICATION_SLOT slot_name [ TEMPORARY ] { PHYSICAL [ RESERVE_WAL ] | LOGICAL output_plugin [ EXPORT_SNAPSHOT
|NOEXPORT_SNAPSHOT | USE_SNAPSHOT | TWO_PHASE ] }
 
>
> to
>
> CREATE_REPLICATION_SLOT slot_name [ TEMPORARY ] { PHYSICAL [ RESERVE_WAL ] | LOGICAL output_plugin } [
EXPORT_SNAPSHOT| NOEXPORT_SNAPSHOT | USE_SNAPSHOT | TWO_PHASE ]
 
>
> ?
>
> I'm not sure, IMHO that would still allow for commands like
>
> CREATE_REPLICATION_SLOT slot_name PHYSICAL output_plugin
>

I don't think so. Symbol '|' differentiates that, check its usage at
other places like Create Table doc page [1]. Considering that, it
seems to me that the way it is currently mentioned in docs is correct.

CREATE_REPLICATION_SLOT slot_name [ TEMPORARY ] { PHYSICAL [
RESERVE_WAL ] | LOGICAL output_plugin [ EXPORT_SNAPSHOT |
NOEXPORT_SNAPSHOT | USE_SNAPSHOT | TWO_PHASE ] }

According to me, this means output_plugin and all other options
related to snapshot can be mentioned only for logical slots.

[1] - https://www.postgresql.org/docs/devel/sql-createtable.html

-- 
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: Replace pg_controldata output fields with macros for better code manageability
Next
From: Peter Eisentraut
Date:
Subject: Re: Add header support to text format and matching feature