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 1kjmyf-0006s7-0k for pgsql-admin@arkaria.postgresql.org; Mon, 30 Nov 2020 17:28:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kjmyd-0005cB-Vp for pgsql-admin@arkaria.postgresql.org; Mon, 30 Nov 2020 17:28:39 +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 1kjmyd-0005c4-Ob for pgsql-admin@lists.postgresql.org; Mon, 30 Nov 2020 17:28:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kjmyb-000518-FW for pgsql-admin@lists.postgresql.org; Mon, 30 Nov 2020 17:28:38 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 0AUHSZ1w1272451; Mon, 30 Nov 2020 12:28:35 -0500 From: Tom Lane To: Yambu cc: Pgsql-admin Subject: Re: Query duration and query text In-reply-to: References: Comments: In-reply-to Yambu message dated "Mon, 30 Nov 2020 19:15:53 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1272449.1606757315.1@sss.pgh.pa.us> Date: Mon, 30 Nov 2020 12:28:35 -0500 Message-ID: <1272450.1606757315@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Yambu writes: > May i know why the query and the duration are recorded as separate lines in > postgres csv logs? log_statement and log_duration are independent features. > Is there a way I can make the query and the duration to be in the same line? If you drop those and instead set log_min_duration_statement = 0 (or some positive value) then the statement will be printed with the duration. regards, tom lane