Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wKWzI-0015m0-2D for pgsql-hackers@arkaria.postgresql.org; Wed, 06 May 2026 07:48:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wKWzG-00FXqn-1x for pgsql-hackers@arkaria.postgresql.org; Wed, 06 May 2026 07:48:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wKWzG-00FXqf-10 for pgsql-hackers@lists.postgresql.org; Wed, 06 May 2026 07:48:06 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wKWzD-00000000mjI-3uSN for pgsql-hackers@postgresql.org; Wed, 06 May 2026 07:48:05 +0000 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-83659d38e38so1468232b3a.1 for ; Wed, 06 May 2026 00:48:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778053681; x=1778658481; darn=postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=xOjmlSvD2309BYaCCLUX+4+YjyaxWh5vykGhF8/orus=; b=r8JpJOnjiQgLmhUNaYSTB9R3BcqEdamTlYg2m2kboycGX9ucsm3PQavizECC8XZLy3 ABY4IGfbJPl2ZSiwJDItfNwYCRlLhAAG1oa+XnFmD0pNMzIUC3z6JdP9bQQWlOFh36l6 4bjZm7BjSq0I+0gy4WjgMGQ7N33SUkISdpMtqpivi/g4KKYnhCazlNfxdEE5hLsnmMKG bD1XBLYmxNgFNxA5OJuZSVqXxDPH5XDUss5vgujLqBQmZdC98TAPQQVAvznAfipYgAVF Y+ZirOYLfInydcdjrPEhnueiDvUA4EqEob1cmyhd0lVt0ccsq6JZCM8+kKIUVMzMec7E tU/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778053681; x=1778658481; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=xOjmlSvD2309BYaCCLUX+4+YjyaxWh5vykGhF8/orus=; b=lPk4AYOgKOk27tHtyiCh99uE5NRtnfTxhCki+6PNx06BGCkVndP9zdfmYFGZi1GkyD et3JryPzh/y769xYexGC8cA0qFwtcnZf/l5wmjqr2RIWP9cHD6RFhmnGTZve+tbkI6+D eJrND4DjSZ1kaqL6fQ2QGNbX3m8RXk/F7Dy9xuY0FL6Z17ylyPdabh2HtfHsezyEKqJn GzTuciPMc/NpIlgKlJwsYXqJhU6D7zI8UaQDl/hS0iKJU2Y60IYbCB4QCNLfdm1RmFNR fkKpnlXte7NnsT/E9qmVT2ZjHe7/0EXit30jPg04EDeR2aiwXFUkRiy7irf0W5LAXSyB nIjw== X-Gm-Message-State: AOJu0YwjgM3gFNWW9MfmbVrX0EGrEnT7IM8wgTe+36od4NmzHgWT2WM6 1hnGn6V/wQ87vQEcPxR8kfU6rADMtYKlxqdQhD09x/GhHasos0HtoCuP X-Gm-Gg: AeBDieuCg4kd6NkX7wVRagrdA8wRHikMsMtPW8aQBf+DvmhYq9ZxYL9VeRiLXa8XIwK QSCWlNKLqmXzvfDOSehJ3ECF+jL36rKz/gU5svC93obQKojHe7WzJf1l8n5jEsxOy1KMUVCEVcD bsUHeQgAypMqwRMN+vX/SdZ3tl8fkPiBxhq8GrRRv8KwQqpysFPvPlRRuDk+B4iugGR0hGCqoD6 ReBCnSvol2yVPFS5vsNIyg02FEUmC6TUrcGeTnatL5AJBxtHAMkeIOEwZbcw4acvjzyexN2agBq 03S1n6WVhNWEj9d/DyEyCcDManH6zcjN6lzCkwCA6GPlVcEL37vEpkYuHbMFz9dhi38DchHVssB SR861TdUq/SvFgREzTecaQr5h00wqvXekAx2uElmxu+XbnoG3STh3Rdwe/uT/xv9kx5MXyMPTQs NoDQSSR1U1Zi+ZmCER45OcGBkspha4OfvrJWTTTwJxCA== X-Received: by 2002:a05:6a00:414c:b0:82f:38df:681c with SMTP id d2e1a72fcca58-83a5b3ca9a1mr2124822b3a.6.1778053681158; Wed, 06 May 2026 00:48:01 -0700 (PDT) Received: from smtpclient.apple ([45.32.121.103]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-839685a8125sm4781229b3a.61.2026.05.06.00.47.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 May 2026 00:48:00 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server From: Chao Li In-Reply-To: Date: Wed, 6 May 2026 15:47:21 +0800 Cc: PostgreSQL-development Content-Transfer-Encoding: quoted-printable Message-Id: <013CFA76-B42A-4351-8698-0B293BABDAE3@gmail.com> References: <960DD2C4-A22C-463A-90ED-86E0FABD8D20@gmail.com> To: Ajin Cherian X-Mailer: Apple Mail (2.3864.400.21) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On May 1, 2026, at 11:58, Ajin Cherian wrote: >=20 > On Thu, Apr 30, 2026 at 2:12=E2=80=AFPM Chao Li = wrote: >>=20 >>=20 >>=20 >>>=20 >>> 2. I think you should add a comment in the function header above >>> GetSubscription() stating that if aclcheck is false, then the = conninfo >>> will be set to null and users need to call GetSubscriptionConnInfo = to >>> get the conninfo. >>=20 >> Updated the header comment. >=20 > /* > * Fetch the subscription from the syscache. > + * > + * If missing_ok is false, throw an error if the subscription is not = found. > + * If true, return NULL in that case. > + * > + * If aclcheck is true, check whether the subscription owner has = permission on > + * the subscription's foreign server, and load the connection string = from the > + * foreign server. Later, GetSubscriptionConnInfo() should be called = to get > + * the connection string. > */ > Subscription * > GetSubscription(Oid subid, bool missing_ok, bool aclcheck) >=20 > I don't think this comment is right. If aclcheck is true, users need > not call GetSubscriptionConnInfo() to get the connection string, as it > is populated in this function itself. It is only if aclecheck is > false, do callers need to do that. > Isn't that the case? There are multiple places in the apply worker > where GetSubscription() is called with aclcheck is true and > GetSubscriptionConnInfo() is not called there. >=20 > regards, > Ajin Cherian > Fujitsu Australia Hi Ajin, Thank you for the comment. After rereading that part, I agree the = wording is not clear. What I meant is that GetSubscriptionConnInfo() is a safe accessor, if = sub->conninfo has already been resolved, it just returns it; otherwise, = it resolves it on demand. So the intended usage is that callers can = consistently use GetSubscriptionConnInfo() when they need the connection = string. I also missed doing a broader search for direct uses of sub->conninfo = and replacing them with GetSubscriptionConnInfo() where appropriate. = Sorry about that. I will address both issues in v3. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/