deep debug log for psql

Matthias Apitz <[email protected]>
Newsgroups gmane.comp.db.postgresql.general
Message-ID <20191121071217.GA3646@c720-r342378>
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, ✉ [email protected], 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
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEXmn7rBYYViyzy/vBR8z35Hb+nREFAl3WOM4ACgkQR8z35Hb+
nRFCMw/+NXi+OCXyWfUJEO4e+f6F2BzCjvUHGOou2DExfAwdmZDkF9KM7K636YF5
wbXg7l+6GAlbhZfV3wK70n6M+7ve1EVPT/egN6LuAsX18VHnheZFlr98tNrZjyCv
VmVRodZ+z5SHx97iAtyr34TGf21jk3zy1skHFNo5EAsEyd7CoOs26G4bBG22Ccqn
4RxBHSfY3+PNcQ6EYsn+Ex5eEIN6gAzTgHma/1C/QrBBZ0PJH5ut+3YRXFglAfPD
L8udmBeYfehX3w8L8qnwMDJwQ7qFvYeXR/STjtLuER1lGsgH660rcQaG6EvBwAx5
OxJsEjmIsoqD/4SuK5aFw0ptULB7+kfuLpSqTXJChhOHEzJyrRLo6ZVRv9+bI9vT
FBHOF6i5NYwy13fIQfeHWBhZRHkCnMW8h+PZLSJ4zpDxLLGs63A8X7Lb5eLal1lB
D8dqQlNWtSAACWpD1W1RQh6wW+GGsM9/WuMcKyvGzjVhh5QW7p9kEnMF3KGzuTPo
5iqCWTZ9CGGpJsbjkFmWz5pkCEgJIEl90YTzRdLcLw2yZivv/3/wHHsaeoEf6oqV
Q9WvypI7gtbHjeLca41gF9p3ZbhbDKYJM5r1wGRC7CseqIxhvVtyKhRnk+MM1RWz
qZ2Reqr0MCXViQOKy2ASQ81xZivyWI0R0yLNXRSSX1uNl3cfdFg=
=liH2
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.