pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Dominique Devienne <ddevienne@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Parsing libpq PQtrace files
Date: Tue, 17 Oct 2023 18:11:56 +0200
Message-ID: <202310171611.ng77x3wnojlr@alvherre.pgsql> (raw)
In-Reply-To: <CAFCRh-8OPoe=0j9v4wth7qU-x4jvjVc8DoOLV66qdnC9Do0ymw@mail.gmail.com>

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)





view thread (3+ messages)  latest in thread

Message-ID: <202310171611.ng77x3wnojlr@alvherre.pgsql>
Permalink:  ../202310171611.ng77x3wnojlr@alvherre.pgsql/
Also on:    postgresql.org/message-id/202310171611.ng77x3wnojlr@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: alvherre@alvh.no-ip.org, ddevienne@gmail.com
  Subject: Re: Parsing libpq PQtrace files
  In-Reply-To: <202310171611.ng77x3wnojlr@alvherre.pgsql>
  References: <CAFCRh-8OPoe=0j9v4wth7qU-x4jvjVc8DoOLV66qdnC9Do0ymw@mail.gmail.com> <202310171611.ng77x3wnojlr@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox