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 1l7Ijg-0005Ui-UQ for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Feb 2021 14:02:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l7Ijf-0001WJ-TE for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Feb 2021 14:02:23 +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 1l7Ijf-0001W5-MF for pgsql-hackers@lists.postgresql.org; Wed, 03 Feb 2021 14:02:23 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7Ijd-0001wm-PM for pgsql-hackers@lists.postgresql.org; Wed, 03 Feb 2021 14:02:22 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id B518C5C01C6; Wed, 3 Feb 2021 09:02:20 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 03 Feb 2021 09:02:20 -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=5ocvVyGe+5kerRW+lhrWxTRq6ETHIBsmmR/IYnY0xnA=; b=JuvpZSFo /zvALPOnGI389pFJqJ1z3NcxkrvpyJq7dfAev9rUnAHdHH5NFIMhGJczlAJtrVBi rFiIKylpo/xKsgkg3gWUsT65IvW6JlWdzy1UQxFz5RmkWmWcGneWXwH/PjP/nwLI Q32vEDpegk8uy1TyDOR7yl6t9UbtcMvlFJTRLp2AYR2gjYO7GOo6rgiOR7qw+pbt SOC6vhH4eYbYTTQqio7w16RoLa1SOra8GibKtlPBiFYjpRxv31ntgqeTCYLg2MtP NIveQm3fz215opH3TRIab8HNEBLt9asdj//IwD4D6xxGvZsZqcbIhLmwoYH2mcat 1lA6Ifb5aNplOQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrgedvgdehkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfggtggugfgjfgesthekre dttderudenucfhrhhomhepkdetlhhvrghrohcujfgvrhhrvghrrgdkuceorghlvhhhvghr rhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepgfdvvedvte eiheevgfeltdetgffghfeghedvleehvdetiedthffgjeegkeekjeeknecukfhppeduledt rdelhedrudelrddujeejnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrg hilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.177]) by mail.messagingengine.com (Postfix) with ESMTPA id 279D9108005F; Wed, 3 Feb 2021 09:02:20 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 8310B2A0BC0; Wed, 3 Feb 2021 11:02:18 -0300 (-03) Date: Wed, 3 Feb 2021 11:02:18 -0300 From: 'Alvaro Herrera' To: "tsunakawa.takay@fujitsu.com" Cc: "iwata.aya@fujitsu.com" , "k.jamison@fujitsu.com" , "'pgsql-hackers@lists.postgresql.org'" Subject: Re: libpq debug log Message-ID: <20210203140218.GA25720@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: Precedence: bulk On 2021-Feb-03, tsunakawa.takay@fujitsu.com wrote: > From: 'Alvaro Herrera' > > > + conn->fe_msg->num_fields != DEF_FE_MSGFIELDS) > > > The rationale for that second condition is this: if the memory allocated > > is the initial size, we don't free memory, because it would just be > > allocated of the same size next time, and that size is not very big, so > > it's not a big deal if we just let it be, so that it is reused if we > > call PQtrace() again later. However, if the allocated size is larger > > than default, then it is possible that some previous tracing run has > > enlarged the trace struct to a very large amount of memory, and we don't > > want to leave that in place. > > Ah, understood. In that case, num_fields should be max_fields. Oh, of course. -- Álvaro Herrera 39°49'30"S 73°17'W "Just treat us the way you want to be treated + some extra allowance for ignorance." (Michael Brusser)