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 1qsmg0-009Mz0-U1 for pgsql-general@arkaria.postgresql.org; Tue, 17 Oct 2023 16:12:13 +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 1qsmfy-00BjrU-48 for pgsql-general@arkaria.postgresql.org; Tue, 17 Oct 2023 16:12:10 +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 1qsmfx-00Bjqm-51 for pgsql-general@lists.postgresql.org; Tue, 17 Oct 2023 16:12:10 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qsmfs-001Cfb-6V for pgsql-general@postgresql.org; Tue, 17 Oct 2023 16:12:09 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 129283200958; Tue, 17 Oct 2023 12:11:59 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 17 Oct 2023 12:12:00 -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:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1697559119; x= 1697645519; bh=MemE0gSFtix5LvPiXP2bra4lEWHIhB3bgGSHN8EtCko=; b=B uboNJTIeEIksZ+jfaqehJqBs776zMBGYQbb/Y4myv2V2f4RpSM3SNAuQ2BYcuKAv q/FMbjzDHryrCgvKHX4dP4lwSe7D3Ph6T5Bcts/ksK6mpvC5BXFRfPG77mSVEMkk nt3uZPrc/XPxghWhWert3qQngJl/zHdcz/G0O/xpchy+yo7yUi+9fZ3jhIGD3J1P 8Rwl4UHGUyURFUrFtwXhN5em44p90LZSpRMwkF3FGJDwRThEVXmjA3vmURsrTfxd VOPiYGNrzvWrlA2TAZ4Mul0n04Ujrx4C8dko/QAYROdo6mSlZqfQH1gLWpDpSgBh BnPiAHODD8uNMJGuEyXlw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjedvgdelhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeejkeff gfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 17 Oct 2023 12:11:59 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1697559116; bh=2negO9rZs1+z5olY/ZjOUIb0zlQKSvuF4REuOh2fD7I=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=IxVVFh53k/sp80xKC8rIn+D3k9yKl+hNxRTKFtvr6IgELvppHU6B4lnnECAw8RkUX PqG7gbRJubsc/4Lr7LkEx06IqCxb22LMAcr8E5Rb9dQwx0pXjWliYn0OWffr6flNY0 NI00sRaDWDy5NmuCbPBOZjKvaVH4KxjKKckhjgfYuZG1uYKKzh99YYtgp/XG710JB/ pMhOyfa2fwKjg/Womg6SINmUfe1ouqjVAs8sEihBrsw4Xeato1lFOHdwXJmWkeBa9b G0KXq2yX3mM2XtJK0DRVkK2Ik4NVzz1I7Zs6hoxfp4BLOfqdGzWUlEgBEgpqMOcpA2 E96Nydt59S16A== Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id C0EC7BD; Tue, 17 Oct 2023 18:11:56 +0200 (CEST) Date: Tue, 17 Oct 2023 18:11:56 +0200 From: Alvaro Herrera To: Dominique Devienne Cc: pgsql-general@postgresql.org Subject: Re: Parsing libpq PQtrace files Message-ID: <202310171611.ng77x3wnojlr@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 2023-Oct-17, Dominique Devienne wrote: > But then on Parse, the query text, which also contains embedded > newlines but also embedded double-quotes, for column aliases, or table > names, or whatever, even why not a single char literal like '"' (i.e. > single-quote, double-quote, single-quote), seems to be double-quoted > only. So how am I supposed to know when the SQL ends? Yeah, I've never heard of anybody trying to machine-parse these lines, so if those points are not addressed in the trace output, that probably explains why. It would probably be a good idea to change that. This stuff is relatively new, and most likely has thus far only used by visual inspecting the contents of the trace file (at least that's how *I* have used them), and only with very simple dummy queries. So, patches welcome, I guess. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "En las profundidades de nuestro inconsciente hay una obsesiva necesidad de un universo lógico y coherente. Pero el universo real se halla siempre un paso más allá de la lógica" (Irulan)