Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: Ajin Cherian <itsajin(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server
Date: 2026-05-06 07:57:51
Message-ID: 8B38AFCA-7FFA-44CF-B9A8-81BDCEAFB224@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On May 6, 2026, at 04:53, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> wrote:
>
> Hello
>
> - server = GetForeignServer(subform->subserver);
> + server = GetForeignServer(sub->serverid);
>
> Couldn't we also move this inside the if?

Ah, true. Both aclresult and server can be moved into the if.

>
> +/*
> + * Return the subscription's connection string, loading it into the
> + * subscription memory context if necessary.
> + *
> + * GetSubscription must be called earlier to set sub->serverid, because ACL
> + * checks are performed there.
> + */
> +char *
> +GetSubscriptionConnInfo(Subscription *sub)
>
> This is related to Ajin's comment earlier, the part about ACL check
> seems incorrect to me.

Yes, see my reply to Ajin in the previous email.

PFA v3 - addressed Ajin and Zsolt’s comments.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

Attachment Content-Type Size
v3-0001-Allow-altering-subscription-server-connection-wit.patch application/octet-stream 16.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2026-05-06 08:08:33 Re: on_error table, saving error info to a table
Previous Message Chao Li 2026-05-06 07:47:21 Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server