From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Matthias Apitz <guru@unixarea.de>
To: pgsql-general@lists.postgresql.org
Subject: Re: deep debug log for psql
Date: Thu, 21 Nov 2019 07:24:37 -0800
Message-ID: <efeeb448-31bd-bd92-c217-695db2886f1e@aklaver.com> (raw)
In-Reply-To: <20191121071217.GA3646@c720-r342378>
References: <20191121071217.GA3646@c720-r342378>
On 11/20/19 11:12 PM, Matthias Apitz wrote:
>
> Hello,
>
> We found and use for ESQL/C the debug feature:
>
> ECPGdebug(int on, FILE *stream);
>
> with very good results. Is there something similar for the psql
> interpreter to debug the query of complex SQL statements like this
> monster here:
>
> SELECT ha.hnr, count(*) FROM acq_haushalt ha, acq_booking bo WHERE ha.hjahr = 2000 AND ha.brgroup
> WHERE bu.bnr = bo.bnr AND bu.band = bo.band AND bu.exemplar = ( SELECT min(bo2.exemplar) FROM acq_booking b
> WHERE bo2.hnr = bo .hnr
> AND bo2.bnr = bo.bnr AND bo2.band = bo.band)
> AND bu.statusrech IN (0,1) )
> GROUP BY ha.hnr;
>
> The -L logfilename flag of psql is not sufficient enough. It logs only
> the query and the final result.
client_min_messages?:
https://www.postgresql.org/docs/11/runtime-config-client.html#GUC-CLIENT-MIN-MESSAGES>
> Thanks
>
> matthias
>
--
Adrian Klaver
adrian.klaver@aklaver.com
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: adrian.klaver@aklaver.com, guru@unixarea.de
Subject: Re: deep debug log for psql
In-Reply-To: <efeeb448-31bd-bd92-c217-695db2886f1e@aklaver.com>
References: <20191121071217.GA3646@c720-r342378> <efeeb448-31bd-bd92-c217-695db2886f1e@aklaver.com>
* 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