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 1iXoK6-00057i-Im for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 15:24:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iXoK4-0001Y1-QN for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 15:24:44 +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 1iXoK4-0001XA-Dq for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 15:24:44 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iXoK1-0004eI-6v for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 15:24:43 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 2D94CADF; Thu, 21 Nov 2019 10:24:39 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 21 Nov 2019 10:24:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=A lmF7kDEluaZzQytOoSg7gEpG0gvZTuj2soE3/RZPqM=; b=QZjFaEqEhaGAcbKZZ Q3LVSMlhzBGZSNl4Rzn4P6nKRNAJ5kjb114dKFmuQSbnOtIKjoIrNYuJiS24hXMH he0wVCAzwXgX0HgipiIi6nVy1QIc33nJzCkQdSxSJz9OVXD0J8y82x6mLP0rzvWM bRgni2myO+GdYaDPuiF+bfbPbyQvSUDJfKGW8ROfwVH9uLd7rIVStJzvSApUGhHd 8YbPb/0CLXR6gUBTAVZ4yuEYmZjWTj4HLfdwXqBE1/Nx5saLT3JCrRI9BMXN2fPT j9UANmkcNyVyAcG24UfXdWvlluh07HYWC2ts0vZOiB2e+6ynAyqdRKSqBrPz8fvl +D2Dg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=AlmF7kDEluaZzQytOoSg7gEpG0gvZTuj2soE3/RZP qM=; b=eVwHJYxglH38eNZAo2AeNaorILDO6VLbQ0hlC1x9RQxSTjY6E02LpP8Yp MkSMwIt1cDb0u12zckcEvSMHiHVQHlpF5oPOeA6Zvd3LCbFXRHKug8sztj1gyxCg DAdiDQwdOWP+NsdGJx6hRRta1QThvLTYKaBdNCjzzy4r1F/vBujBlRgD3AEmsOWn DXQYCNcU2SwG7468p7Diis8WeqUzqhCvIol3uEX/AARFAEee2XRdm+V4amofo7/i dSBEtndyE0JGTGFR+tYH8Maco4+TxfLCExLMSO/d4afftAOp7QsAOpGzf280hk9L OKXvtzPyR6NN4eYULlnTW9+ChhFZg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudehvddgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtje ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuffhomhgrihhnpehpohhsthhgrhgvsh hqlhdrohhrghenucfkphepjedurddvuddvrddufeefrdduudeknecurfgrrhgrmhepmhgr ihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmnecuve hluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.1.2] (unknown [71.212.133.118]) by mail.messagingengine.com (Postfix) with ESMTPA id DB0E380060; Thu, 21 Nov 2019 10:24:37 -0500 (EST) Subject: Re: deep debug log for psql To: Matthias Apitz , pgsql-general@lists.postgresql.org References: <20191121071217.GA3646@c720-r342378> From: Adrian Klaver Message-ID: Date: Thu, 21 Nov 2019 07:24:37 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20191121071217.GA3646@c720-r342378> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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