Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lh8Kl-0001mV-VX for pgsql-hackers@arkaria.postgresql.org; Thu, 13 May 2021 10:12:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lh8Kk-0001ai-Db for pgsql-hackers@arkaria.postgresql.org; Thu, 13 May 2021 10:12:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lh8Kk-0001aa-5z for pgsql-hackers@lists.postgresql.org; Thu, 13 May 2021 10:12:46 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lh8Kh-0006pH-Lg for pgsql-hackers@postgresql.org; Thu, 13 May 2021 10:12:45 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id 8E8DC60F28; Thu, 13 May 2021 19:12:39 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.2 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 13 May 2021 19:12:39 +0900 From: torikoshia To: Bharath Rupireddy Cc: dilipbalaut@gmail.com, Pgsql Hackers Subject: Re: RFC: Logging plan of the running query In-Reply-To: References: User-Agent: Roundcube Webmail/1.4.11 Message-ID: <7c80e4a2d41232eefcdb418c70c4a1a1@oss.nttdata.com> X-Sender: torikoshia@oss.nttdata.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-05-13 18:36, Bharath Rupireddy wrote: > On Thu, May 13, 2021 at 2:57 PM Bharath Rupireddy > wrote: >> On Thu, May 13, 2021 at 2:44 PM Dilip Kumar >> wrote: >> > +1 for the idea. I did not read the complete patch but while reading >> > through the patch, I noticed that you using elevel as LOG for printing >> > the stack trace. But I think the backend whose pid you have passed, >> > the connected client to that backend might not have superuser >> > privileges and if you use elevel LOG then that message will be sent to >> > that connected client as well and I don't think that is secure. So >> > can we use LOG_SERVER_ONLY so that we can prevent >> > it from sending to the client. >> >> True, we should use LOG_SERVER_ONLY and not send any logs to the >> client. Thanks, agree with changing it to LOG_SERVER_ONLY. > I further tend to think that, is it correct to log queries with LOG > level when log_statement GUC is set? Or should it also be > LOG_SERVER_ONLY? I feel it's OK to log with LOG_SERVER_ONLY since the log from log_statement GUC would be printed already and independently. ISTM people don't expect to log_statement GUC works even on pg_log_current_plan(), do they? Regards, -- Atsushi Torikoshi NTT DATA CORPORATION