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 1w0UPy-001wzU-11 for pgsql-committers@arkaria.postgresql.org; Thu, 12 Mar 2026 01:00:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w0UOx-00ClX9-1W for pgsql-committers@arkaria.postgresql.org; Thu, 12 Mar 2026 00:59:47 +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 1w0UOx-00ClX1-0O for pgsql-committers@lists.postgresql.org; Thu, 12 Mar 2026 00:59:47 +0000 Received: from mail-dy1-x1336.google.com ([2607:f8b0:4864:20::1336]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w0UOu-00000002DuK-3a6C for pgsql-committers@lists.postgresql.org; Thu, 12 Mar 2026 00:59:47 +0000 Received: by mail-dy1-x1336.google.com with SMTP id 5a478bee46e88-2be3bdfda8eso672168eec.1 for ; Wed, 11 Mar 2026 17:59:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1773277182; x=1773881982; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=Bb5GHUDBqeTFA2iz1AJs7pxLst63yvHWiOpn4eSWz/Y=; b=ZStwYF+dsK06A9x9N9VVihEa6FmeADEVcdqrWCcyxS8GTKDa52kxm4Lk1Y/FVZNuul n1nOMM66OZ3Ak37RewQ44z8DTycmaGGb6QT5uUXCi7k0uAK6euANp7C1fEl0lFa0/c/8 D7RLNsQ2o0+Rq2N2zXhWrOgBBtynmhLRCmEXk+khaF+XImQUBDrNWlMXrmR096wlvTFZ mXIT5++hDyD4Lvnj7zOQvTaRHJl1/N3pCda6xULmaPkOaApqHi5oChZ+vTkccyzFVof1 FYSQ5RpC65x5vtKWjM/MvsaLxms04ETcE9fo9TtuHE7RoeFECYuoMT/4UQLD9FADo4Ox Cx0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773277182; x=1773881982; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Bb5GHUDBqeTFA2iz1AJs7pxLst63yvHWiOpn4eSWz/Y=; b=f5OA1KhkTJ9cNcMBSsExM+epACPB8b1cv/cPQDMTPP0uhVMQCb9VKIWuhEwreRkqdk yfUvcKBlu25aCbIit/CjUxXub4RaT63UVjec3MrWgFu+P5q0YS0pMeJJ50vnpWciJ7tP 3qKgXqRS9H8iTJ0H2E01vwDnRn0zDE1d4zia2OJytbRQk7MXJ6mQH7DLWDviqKgvVWC1 wJ/3D/6C5gE3mL9FCWiO2M1ICgknyCxBGTb7xzA86m+NhsILmtuB6OhUYZq5UiA4MzTX Sr0ojDxJHmJulQX6vaCCct1pnMOePv21+XHtPfC3BlIZK7IuahUAUtHTuA3rY/GwhyG3 fzHQ== X-Forwarded-Encrypted: i=1; AJvYcCW7Pymn6E5cb9K1NdmTm88u17y+p8ZIyAnS7r9hwbAV+71+sPDDBWSy88P79VVwjDu7tRERLqjjijqN4jv75Nkp@lists.postgresql.org X-Gm-Message-State: AOJu0Yw+X5VKThl6tOoVLksEgmOuie/rAtx0xIeIiRJfK6K38VikhvSr Yl7b/04OrRCpUX4C9MbEHSbJEfFo958g9SmXr9p5E8Bxc7PyvLZ7wb/QmEIzkFNGvw== X-Gm-Gg: ATEYQzwA8Y/OU0QBK4LBhqPra/u7o8IXildFwxjhnSrHrqxl7Mw/p7e5pP8ygqgiwa7 xjkFob9qoj9SdLZBC/2v/syma84lUdHjXfroK5+RyIdJ91yXEqSeborAeNb1JOytgiWLvCHlGyK 9LyDDw9b1mql1kVRGfa4G+felDOdX9//AOmEBBG1AFS+ssEvwaDwVZhM3rc1DyGu/FqlBB+qzcW oNDhMqo7qIes3UZQcNGuwEKiifJ7bwZcLLfzw72UZ4no4s4eiCU5xHTyzYBhfEj4X6evLY9FtJY e/VHEvizMk6+2iWkmRAHAqZMPIviOKN9o43HJlAzgB6zyd9VCAIFBoU/YrNkb+TeJck6qqEyhNc DeHcQwqONyK4EjAffjENdmd+wNpqBgdmne11amX9aFoYmcwZXZytniKREjuvooD4UZh4BBYBWS1 yYmwNqbAG0t4LCRit4aY5aeT7yi3xnofSfPqMpckIpPDmXpGx52Sg= X-Received: by 2002:a05:7300:f18e:b0:2b8:4a34:6c39 with SMTP id 5a478bee46e88-2be8a2b9f9emr2144689eec.16.1773277182198; Wed, 11 Mar 2026 17:59:42 -0700 (PDT) Received: from jeff-laptop.lan (c-24-7-19-3.hsd1.ca.comcast.net. [24.7.19.3]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2be8a87443fsm4437274eec.15.2026.03.11.17.59.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2026 17:59:41 -0700 (PDT) Message-ID: <03d52b80fd264bb683fb2c46ad7a2934cb656f1a.camel@j-davis.com> Subject: Re: pgsql: CREATE SUBSCRIPTION ... SERVER. From: Jeff Davis To: Andres Freund , Peter Eisentraut Cc: Jeff Davis , pgsql-committers@lists.postgresql.org Date: Wed, 11 Mar 2026 17:59:40 -0700 In-Reply-To: References: <1bb21c7d-885f-4f07-a3ed-21b60d7c92c6@eisentraut.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3-0ubuntu1.1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2026-03-11 at 17:49 -0400, Andres Freund wrote: > The only reason connection_text needs to be volatile is because it's > modified > in PG_TRY and then accessed in PG_FINALLY.=C2=A0 But what's the point of > the > latter? If an error was thrown, why would we want to construct the > 'result' > string, as the error isn't caught, there's no PG_CATCH.=C2=A0 So now the > function > builds the result string in case of an error, just to throw it away. I believe it would be correct if the variable was not volatile at all, because it's only set in the last statement of PG_TRY(), so the PG_FINALLY() will never need to read the modified variable on the error path. I added the volatile to follow the expected pattern, in case the code is adjusted later. That leaves some awkwardness, but I don't immediately see a cleaner way to do it. Suggestions welcome. > I'm also rather unconvinced by ForeignServerConnectionString() > creating a > temporary memory context. When would you ever use the function in a > long lived > memory context? It's called by GetSubscription(), and the context is ApplyContext. Regards, Jeff Davis