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 1wVVlc-0020v1-1o for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Jun 2026 14:43:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wVVla-00CxKv-2E for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Jun 2026 14:43:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wVVla-00CxKn-1K for pgsql-hackers@lists.postgresql.org; Fri, 05 Jun 2026 14:43:22 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wVVlY-00000001Fgr-2bHP for pgsql-hackers@lists.postgresql.org; Fri, 05 Jun 2026 14:43:21 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 655EhGBB3592597; Fri, 5 Jun 2026 10:43:16 -0400 From: Tom Lane To: Fujii Masao cc: Chao Li , Postgres hackers , vignesh C Subject: Re: Prevent remote libpq notices from being sent to clients In-reply-to: References: <396C3BEE-CD4D-450A-8D28-E708E9AA4075@gmail.com> Comments: In-reply-to Fujii Masao message dated "Fri, 05 Jun 2026 23:28:44 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <3592595.1780670596.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 05 Jun 2026 10:43:16 -0400 Message-ID: <3592596.1780670596@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Fujii Masao writes: > On Fri, Jun 5, 2026 at 6:32=E2=80=AFPM Chao Li = wrote: >> So remote messages should only be output to the server log, but current= ly they can leak to the client if client_min_messages is set to log. > I'm not sure whether it's good idea to add this limitation. I was just about to answer saying that I didn't think so. I'm concerned that there might be no other way to obtain such output. It's likely that the remote server doesn't log NOTICE-level messages, and even if it does, you might not have access to its log. Also, I don't buy the argument that this is a "leak": if the remote server was willing to send the message to its client, it doesn't think that the message is security-critical. What I think there might be a good case for is to use the same ereport level that was used to issue the remote's message, rather than always LOG level. I'm not sure if we can reconstruct that completely, but we can certainly tell NOTICE from WARNING, for instance. regards, tom lane