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 1lPsRy-0001rn-NV for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Mar 2021 19:48:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lPsRx-0001ht-BC for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Mar 2021 19:48:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lPsRx-0001hl-4a for pgsql-hackers@lists.postgresql.org; Fri, 26 Mar 2021 19:48:53 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lPsRs-0007fV-EP for pgsql-hackers@lists.postgresql.org; Fri, 26 Mar 2021 19:48:52 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 189515C00E1; Fri, 26 Mar 2021 15:48:46 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 26 Mar 2021 15:48:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=F5X60LrIiLzolCKxnPIeMA//BeQZNQ5zRUUfWRCLj2M=; b=XXLNL6+R dmu09K+ALEnoOa4Vqn9I4ZMEtwZB2Sj+QZM9yc+9zJvbuwMMRL302FH7jiJo1jkk sNWiEYQBJnZuIsCK492Vvtmd2DqbWn2bu3KvrZyWsvvTFyFOYIPp90g0p59DUnGj paWb5BhDxwutnPIsrGGmkGO5G2HpVo/d7Fv7zSfaFXzo6a4nygcaqK28GcbGheTb p0N5SGXufcIvE2z5Xo1ruJuAnuhN2RfrhFDq/qupH/eOEA+fZRoffBsrR2RfwEvE uizLeifOZN12Py4ZpamPadoHlUY96Fh005NKt/5X8P2/PvvNSbZfv7Kz16MzHYga bIUaiAYjbbNGLA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudehvddgudefgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfggtggugfgjfgesth ekredttderudenucfhrhhomhepfdgrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdho rhhgfdcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqeenucggtffrrg htthgvrhhnpeevgfeffffhgfefgfffjedtjedtjefhgfetveefleeiuddujeejhfehvefh udettdenucfkphepudeltddrleehrdduledrleehnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhi phdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.95]) by mail.messagingengine.com (Postfix) with ESMTPA id 1D623108005F; Fri, 26 Mar 2021 15:48:45 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 4CE4E2A0FE5; Fri, 26 Mar 2021 16:48:42 -0300 (-03) Date: Fri, 26 Mar 2021 16:48:42 -0300 From: "alvherre@alvh.no-ip.org" To: "tsunakawa.takay@fujitsu.com" Cc: "iwata.aya@fujitsu.com" , 'Kyotaro Horiguchi' , "tgl@sss.pgh.pa.us" , "k.jamison@fujitsu.com" , "pgsql-hackers@lists.postgresql.org" Subject: Re: libpq debug log Message-ID: <20210326194842.GA30980@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello I added an option to the new libpq_pipeline program that it activates libpq trace. It works nicely and I think we can add that to the regression tests. However I have two observations. 1. The trace output for the error message won't be very nice, because it prints line numbers. So if I want to match the output to an "expected" file, it would break every time somebody edits the source file where the error originates and the ereport() line is moved. For example: < 70 ErrorResponse S "ERROR" V "ERROR" C "22012" M "division by zero" F "numeric.c" L "8366" R "div_var" \x00 "Z" The line number 8366 in this line would be problematic. I think if we want regression testing for this, we should have another trace flag to suppress output of a few of these fields. I would have it print only S, C and M. (Hey, what the heck is that "Z" at the end of the message? I thought the error ended right at the \x00 ...) 2. The < and > characters are not good for visual inspection. I replaced them with F and B and I think it's much clearer. Compare: > 27 Query "SET lc_messages TO "C"" < 8 CommandComplete "SET" < 5 ReadyForQuery I > 21 Parse "" "SELECT $1" 1 23 > 19 Bind "" "" 0 1 1 '1' 1 0 > 6 Describe P "" > 9 Execute "" 0 > 4 Sync < 4 ParseComplete < 4 BindComplete < 33 RowDescription 1 "?column?" 0 0 23 4 -1 0 < 11 DataRow 1 1 '1' < 13 CommandComplete "SELECT 1" < 5 ReadyForQuery I > 4 Terminate with F 27 Query "SET lc_messages TO "C"" B 8 CommandComplete "SET" B 5 ReadyForQuery I F 21 Parse "" "SELECT $1" 1 23 F 19 Bind "" "" 0 1 1 '1' 1 0 F 6 Describe P "" F 9 Execute "" 0 F 4 Sync B 4 ParseComplete B 4 BindComplete B 33 RowDescription 1 "?column?" 0 0 23 4 -1 0 B 11 DataRow 1 1 '1' B 13 CommandComplete "SELECT 1" B 5 ReadyForQuery I F 4 Terminate I think the second one is much easier on the eye. (This one is the output from "libpq_pipeline simple_pipeline"). -- Álvaro Herrera Valdivia, Chile "Saca el libro que tu religión considere como el indicado para encontrar la oración que traiga paz a tu alma. Luego rebootea el computador y ve si funciona" (Carlos Duclós)