Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fwbDv-0006Zs-IY for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Sep 2018 22:52:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fwbDt-0004Mj-Md for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Sep 2018 22:52:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fwbDt-0004Mc-Fe for pgsql-hackers@lists.postgresql.org; Sun, 02 Sep 2018 22:52:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fwbDq-0001kV-TF for pgsql-hackers@postgresql.org; Sun, 02 Sep 2018 22:52:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w82MpqCe003270; Sun, 2 Sep 2018 18:51:52 -0400 From: Tom Lane To: Robert Haas cc: "Iwata, Aya" , "pgsql-hackers@postgresql.org" Subject: Re: libpq debug log In-reply-to: References: <71E660EB361DF14299875B198D4CE5423DE3FBA4@g01jpexmbkw25> <25774.1535118514@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Sun, 02 Sep 2018 18:42:44 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3268.1535928712.1@sss.pgh.pa.us> Date: Sun, 02 Sep 2018 18:51:52 -0400 Message-ID: <3269.1535928712@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > On Fri, Aug 24, 2018 at 9:48 AM, Tom Lane wrote: >> PQtrace() is utterly useless for anything except debugging libpq >> internals, and it's not tremendously useful even for that. Don't >> bother with that part. > I think that improving the output format could help with that a lot. > What it current produces is almost unreadable; adjusting it to emit > one line per protocol message would, I think, help a lot. There are > probably other improvements that could be made at the same time. I wouldn't mind throwing it out and reimplementing it ;-) ... tracing at the logical message level rather than the byte level would help. But still, I'm not really convinced that it has very much to do with what you'd want in a user-level debug log. Part of what's really bad about the PQtrace output is that in v2 protocol the same output can be repeated several times as we try to parse a message and conclude we don't have it all yet. I believe that problem is gone in v3, but it may be hard to do a consistent redesign until we nuke libpq's v2 support. Still, it might be past time for the latter, seeing that we no longer promise pre-7.4 compatibility in either psql or pg_dump. regards, tom lane