pg.ddx.io pgsql-general@postgresql.org mailing list archivehelp / color / mirror / Atom feed
deep debug log for psql 2+ messages / 2 participants [nested] [flat]
* deep debug log for psql @ 2019-11-21 07:12 Matthias Apitz <guru@unixarea.de> 2019-11-21 15:24 ` Re: deep debug log for psql Adrian Klaver <adrian.klaver@aklaver.com> 0 siblings, 1 reply; 2+ messages in thread From: Matthias Apitz @ 2019-11-21 07:12 UTC (permalink / raw) To: pgsql-general@lists.postgresql.org 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. Thanks matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub "Glaube wenig, hinterfrage alles, denke selbst: Wie man Manipulationen durchschaut" "Believe little, scrutinise all, think by your own: How see through manipulations" ISBN-10: 386489218X Attachments: signature.asc (application/pgp-signature, 832B) download ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: deep debug log for psql 2019-11-21 07:12 deep debug log for psql Matthias Apitz <guru@unixarea.de> @ 2019-11-21 15:24 ` Adrian Klaver <adrian.klaver@aklaver.com> 0 siblings, 0 replies; 2+ messages in thread From: Adrian Klaver @ 2019-11-21 15:24 UTC (permalink / raw) To: Matthias Apitz <guru@unixarea.de>; pgsql-general@lists.postgresql.org 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 ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2019-11-21 15:24 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-11-21 07:12 deep debug log for psql Matthias Apitz <guru@unixarea.de> 2019-11-21 15:24 ` Adrian Klaver <adrian.klaver@aklaver.com>
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