Re: Tracing libpq client: Only with PQtrace()? - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Tracing libpq client: Only with PQtrace()?
Date
Msg-id 202404091501.e4buwthhrd27@alvherre.pgsql
Whole thread Raw
In response to Re: Tracing libpq client: Only with PQtrace()?  (Greg Sabino Mullane <htamfids@gmail.com>)
List pgsql-general
On 2024-Apr-09, Greg Sabino Mullane wrote:

> On Tue, Apr 9, 2024 at 8:51 AM Sebastien Flaesch <sebastien.flaesch@4js.com>
> 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)



pgsql-general by date:

Previous
From: Thiemo Kellner
Date:
Subject: [MASSMAIL][Code: 0, SQL State: 0A000] when "typing" from pg_catalog
Next
From: Adrian Klaver
Date:
Subject: Re: [Code: 0, SQL State: 0A000] when "typing" from pg_catalog