Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ruCya-003Uek-Lr for pgsql-general@arkaria.postgresql.org; Tue, 09 Apr 2024 15:01:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ruCyZ-006L2U-QP for pgsql-general@arkaria.postgresql.org; Tue, 09 Apr 2024 15:01:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ruCyZ-006L2M-Db for pgsql-general@lists.postgresql.org; Tue, 09 Apr 2024 15:01:31 +0000 Received: from fout3-smtp.messagingengine.com ([103.168.172.146]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ruCyV-0002Nt-5K for pgsql-general@lists.postgresql.org; Tue, 09 Apr 2024 15:01:30 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id 10B8E13800A2; Tue, 9 Apr 2024 11:01:25 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 09 Apr 2024 11:01:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712674885; x= 1712761285; bh=/ansiI5sh9ZUuro1WLNhdE6W57TA6lMpPkUeXSv2HGE=; b=L vv5NtXBXjvtGjr7b3GoEk6dD8SHHyUStZwpVRx+w7xGISZFuEEeoX0FbSf/umje/ lTXcRhB2nbu9Mg2ilUA9OYGd32kiBIwdhYViW3PYUl3nhnLQnzIe//SOfXT5cxw8 nMhm0/2L6O2e6IMIL38cxVQCuRbzDh08drDs/JCI8zd0gLwhRKCUqHzfXEqX5BbM hiXljmPtBpkWF6KTevZEZhvmsGK+rRzk+//9cpExUBgUWZJJ/neZN+RFyWSAV5Pp Hc2+AC+cFChEBw4ellMa+xcRap/sLkQKBu6ms41e5YWReHMhZHldRt5EtNxgOmK1 iCyC1bLo7/0kArsTjTe8Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudehvddgudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepieeujeefffdtueeijeegvdeifeejhfekjeelvedttdeu vddvkeekhfehgedujeevnecuffhomhgrihhnpehmvghtrggtphgrnhdrohhrghdpvghnth gvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 9 Apr 2024 11:01:24 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1712674882; bh=DJlk9KLDOTyBR6OqZYsnE5DgixAsj6Rb96AivsLHfwE=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Y+IrrapCB2+ux+6ADuzQyLN1+mBzFmW9T2n0pp1AOtlYAbSHdxxdHvkQar+re1xG5 HZh0ef7n2oCTd6oakQcNe5YNMqB0g+pbAkmVYqxAan1twE8/m3mCGmjWiWxfrO7NBW GotQszX4x0aNQ5yY0N66LDG+cOQ3xLh/V5BYXlKEVhgA+/TCzJxQENwcn3k+OQWcpp wp3NmpVAYnrUCTm4b5FO7ZrKcz22pNWIh598PNLfKkYv2pt+1puVKBVQ4Mzp5Xjfrr oQKiVvDw3g8/cal1/fdumC9ftMgG0qtxyHTQV2v5m12TH8dL/yy5CGdNjekpV8BQR6 yes7nkatrXrWA== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 9E49936E; Tue, 9 Apr 2024 17:01:22 +0200 (CEST) Date: Tue, 9 Apr 2024 17:01:22 +0200 From: Alvaro Herrera To: Greg Sabino Mullane Cc: Sebastien Flaesch , pgsql-general Subject: Re: Tracing libpq client: Only with PQtrace()? Message-ID: <202404091501.e4buwthhrd27@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Apr-09, Greg Sabino Mullane wrote: > On Tue, Apr 9, 2024 at 8:51 AM Sebastien Flaesch > wrote: > > > Is the PQtrace() API the only way to enable libpq client tracing? > > > > I thought about some environment variable of client configuration > > setting... > > That's generally the job of the client, or more specifically, the driver > providing the interface between your program and the libpq API. Unless you > are writing at the low level yourself, in which case, you would need to > have your program detect an env and call PQtrace() as needed. > > See for example > https://metacpan.org/pod/DBD::Pg#parse_trace_flag-and-parse_trace_flags Another approach might be to use Wireshark, which has a decoder for the Postgres FE/BE protocol. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "Pido que me den el Nobel por razones humanitarias" (Nicanor Parra)