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 1lIAhm-0006z2-Dr for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Mar 2021 13:41:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lIAhl-0002Ac-9d for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Mar 2021 13:41:21 +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 1lIAhk-00028h-Ay for pgsql-hackers@lists.postgresql.org; Fri, 05 Mar 2021 13:41:21 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lIAhe-0007Dj-2f for pgsql-hackers@lists.postgresql.org; Fri, 05 Mar 2021 13:41:19 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 20A655C0045; Fri, 5 Mar 2021 08:41:13 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 05 Mar 2021 08:41:13 -0500 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=DRcsciN5hRFikCytC2/cDPV+PNYToYMOKJLHUvz4/G4=; b=B1EAM1GY OI+7NpAdYqU/TaNQcVN1yYHw7hyI5RvnNrMFK1uaFIrcQpaN8wvyF5Ib88tcIjNE FyzDklAIZ2wXZxrJHVoehFVYasm+CL/MVQcrC16TiI02UBVh+WUVON3hcn9qgTE9 CAlAP3EjKwCJAADIbEerNYDE6k49s5vN6FM/Rlg68MMDT7HOZjiVEaIt0z8gzX9H sLqilqC7XTrnQxlofYKTwCHQYCOPYb1t7U14t8eysiu1dVNOHN1eEndQTjSlgqAs WSGQhDdrf4h1cZ8EhQ8AQPfyV7/l0AB0dVKbF6PyybSsEpP94LZzLtuIk88CccII 97fY1zXGHjYRHQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddtiedgheduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkgggtugfgjggfsehtke ertddtredunecuhfhrohhmpedfrghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhr ghdfuceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrth htvghrnhepvefgfeffhffgfefgffejtdejtdejhffgteevfeelieduudejjefhheevhfdu tedtnecukfhppeduledtrdelhedrudelrdelheenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhp rdhorhhg X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.95]) by mail.messagingengine.com (Postfix) with ESMTPA id DB08C1080057; Fri, 5 Mar 2021 08:41:11 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 5404E2A14F6; Fri, 5 Mar 2021 10:41:09 -0300 (-03) Date: Fri, 5 Mar 2021 10:41:09 -0300 From: "alvherre@alvh.no-ip.org" To: "tsunakawa.takay@fujitsu.com" Cc: 'Tom Lane' , "iwata.aya@fujitsu.com" , "k.jamison@fujitsu.com" , 'Kyotaro Horiguchi' , "pgsql-hackers@lists.postgresql.org" Subject: Re: libpq debug log Message-ID: <20210305134109.GA21852@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 On 2021-Mar-05, tsunakawa.takay@fujitsu.com wrote: > From: Tom Lane > > But I think passing the message start address explicitly might be > > better than having it understand the buffering behavior in enough > > detail to know where to find the message. Part of the point here > > (IMO) is to decouple the tracing logic from the core libpq logic, in > > hopes of not having common-mode bugs. > > Ouch, you're perfectly right. Then let's make the signature: > > void pqLogMessage(PGconn *conn, const char *message, bool toServer); Yeah, looks good! I agree that going this route will result in more trustworthy trace output. -- Álvaro Herrera 39°49'30"S 73°17'W