Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXgdj-0004A4-Dj for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 07:12:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iXgdi-0000YV-4O for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 07:12:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXgdh-0000YN-Nz for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 07:12:29 +0000 Received: from ms-10.1blu.de ([178.254.4.101]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iXgde-0000dE-MI for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 07:12:28 +0000 Received: from [188.174.82.72] (helo=localhost.unixarea.de) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.86_2) (envelope-from ) id 1iXgdY-00082T-7q; Thu, 21 Nov 2019 08:12:20 +0100 Received: from localhost.my.domain (localhost [127.0.0.1]) by localhost.unixarea.de (8.15.2/8.14.9) with ESMTPS id xAL7CIuQ003786 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 Nov 2019 08:12:18 +0100 (CET) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.15.2/8.14.9/Submit) id xAL7CHgJ003785; Thu, 21 Nov 2019 08:12:17 +0100 (CET) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Thu, 21 Nov 2019 08:12:17 +0100 From: Matthias Apitz To: pgsql-general@lists.postgresql.org Subject: deep debug log for psql Message-ID: <20191121071217.GA3646@c720-r342378> Reply-To: Matthias Apitz MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline X-Operating-System: FreeBSD 13.0-CURRENT r342378 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. User-Agent: Mutt/1.11.1 (2018-12-01) X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 188.174.82.72 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 =3D 2000 AND ha.brgroup WHERE bu.bnr =3D bo.bnr AND bu.band =3D bo.band AND bu.exemplar =3D ( SE= LECT min(bo2.exemplar) FROM acq_booking b WHERE bo2.hnr =3D bo .hnr AND bo2.bnr =3D bo.bnr AND bo2.band =3D bo.band) AND bu.statusrech IN (0,1) )=20 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 --=20 Matthias Apitz, =E2=9C=89 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 durc= hschaut" "Believe little, scrutinise all, think by your own: How see through manipul= ations" ISBN-10: 386489218X --uAKRQypu60I7Lcqm Content-Type: application/pgp-signature; name="signature.asc" -----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----- --uAKRQypu60I7Lcqm--