Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server - Mailing list pgsql-hackers

From Shlok Kyal
Subject Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server
Date
Msg-id CANhcyEXoFVObwpVPRRzw6k5-nEK3mvAM7Yk0tZTt9Yfq428MHg@mail.gmail.com
Whole thread
In response to Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server  (Chao Li <li.evan.chao@gmail.com>)
List pgsql-hackers
On Thu, 30 Jul 2026 at 07:52, Hayato Kuroda (Fujitsu)
<kuroda.hayato@fujitsu.com> wrote:
>
> Dear Shlok,
>
> > Thanks for reviewing the patch. I have updated the patch and attached
> > the v2 patch.
>
> Thanks for the update. According to others, different kinds of statements should be
> different else-if statements. So we may have to be something like below:
>
> ```
>         else if (stmt->kind == ALTER_SUBSCRIPTION_REFRESH_PUBLICATION)
>         {
>                 ...
>         }
>         else if (stmt->kind == ALTER_SUBSCRIPTION_ADD_PUBLICATION ||
>                          stmt->kind == ALTER_SUBSCRIPTION_DROP_PUBLICATION ||
>                          stmt->kind == ALTER_SUBSCRIPTION_SET_PUBLICATION)
>         {
>                 if (IsSet(opts.specified_opts, SUBOPT_REFRESH) && opts.refresh)
>                         ...
>         }
> ```
>
I have modified the code as per your suggestions.

But, for ALTER SUBSCRIPTION ... ADD/DROP/SET PUBLICATION by default
'refresh' option is true. So even if the refresh option is not
specified explicitly, we should validate the server.
So instead of "if (IsSet(opts.specified_opts, SUBOPT_REFRESH) &&
opts.refresh)", I have used "if(opts.refresh)".
Please let me know if I am missing something.

Attached the updated patch.

Thanks,
Shlok Kyal

Attachment

pgsql-hackers by date:

Previous
From: "chee.wooson"
Date:
Subject: Re: [PATCH v2] Fix exported snapshot xmin handoff race
Next
From: Hannu Krosing
Date:
Subject: Re: COPY TO BLACKHOLE / pg_dump -j -Fb