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 1iDTwp-00021f-SF for pgsql-general@arkaria.postgresql.org; Thu, 26 Sep 2019 13:36:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iDTvq-0000Ab-MR for pgsql-general@arkaria.postgresql.org; Thu, 26 Sep 2019 13:35:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDTvp-0008R2-2c for pgsql-general@lists.postgresql.org; Thu, 26 Sep 2019 13:35:42 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDTvk-0001uM-9T for pgsql-general@lists.postgresql.org; Thu, 26 Sep 2019 13:35:40 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id D98252202C; Thu, 26 Sep 2019 09:35:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 26 Sep 2019 09:35:32 -0400 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=g mNxk54EAFEBvwWEZOpcoYAJuJ1Fk/7/g/BAT9twB+Y=; b=CN2jg/IGTCcNymWob T+AurAiaKYugrvo6yL0qMz7TFytL2GR0Rjc45GsLkkGcWGd8NcmSGf9aL6u+jEL3 yyphb6BzoYgd/DNefLWWcmE9thX9IViWaKfgljEXW9dD26YcAGxFygD8gLViDEAg MvMCY0pC+MhSFNF3zZ9L7onNDFNB6QMk8G1q2zwwRE43yy6ed+/BU/TPl6obBZtV F3dtUKzcYSSEm7v5Us8A0wFurG5U3rArZBapFPesE3NeraRjCiQP8vQzelH7SlFl p72qbIEH/fodSNf4WsaRXVovj0JH4DK0N7ryxAWV6AjaGo0buGh71g5e++WqkosX jergA== 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=fm3; bh=gmNxk54EAFEBvwWEZOpcoYAJuJ1Fk/7/g/BAT9twB +Y=; b=czki+apEPnHEJNWXoSDtyX/KmNwtGvLS9d91XWJENW0PpNxL/3zIzKkm4 tZu5/ONv9bYxFCbIG5ZFsX71pmgMp9MyJNEEuLPMko149p1chcifkC0D15WiOrA/ PHqmwy9Z8z/cXht+EoPTqR+q3v9IzL9gNVLSuclmADlZf1jg7WNq/GWY9YbAD2v8 5svErCa1yweW999pk2fYjXmELFUN9MSUNN5rlLetkEURJ77OAbXovvzrQDi0Mfvr iKu2eMfLJbCBN3A0YBH+TQ+WSP9qqtDn1s8of+fnyTLNiSIMq0qeRR2YKtjt+ItA lRKXzzHst8Ff28w5w64z7FAZzvzQA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrfeeggdeihecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenucfkphepjedurddvuddv rdduhedtrddvvdejnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrg hvvghrsegrkhhlrghvvghrrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.1.3] (unknown [71.212.150.227]) by mail.messagingengine.com (Postfix) with ESMTPA id 7A7F380059; Thu, 26 Sep 2019 09:35:31 -0400 (EDT) Subject: Re: Use of ?get diagnostics'? To: Thiemo Kellner , PostgreSQL General References: <20190921075700.Horde.7M0WmarMSSL6-CZvUSrg4Dg@webmail.gelassene-pferde.biz> <875zlmoyg5.fsf@news-spur.riddles.org.uk> <20190922183304.Horde.3Br7o_R17F7ZB9s9Qp6HweH@webmail.gelassene-pferde.biz> <3bd52383-1711-0240-eab8-db645e8e619d@aklaver.com> <20190926054418.Horde.JG3i7Er5VDQBFQF4uEfhCVR@webmail.gelassene-pferde.biz> From: Adrian Klaver Message-ID: Date: Thu, 26 Sep 2019 06:35:30 -0700 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: <20190926054418.Horde.JG3i7Er5VDQBFQF4uEfhCVR@webmail.gelassene-pferde.biz> 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 9/25/19 10:44 PM, Thiemo Kellner wrote: > Hello Adrian > > Quoting Adrian Klaver : > >> To get above I believe you will need to use GET CURRENT DIAGNOSTICS >> PG_CONTEXT: > > I actually use "get stacked diagnostics" to retrieve the exception > place. And it works. I am not sure why I did no see it. GET [ CURRENT ] DIAGNOSTICS: https://www.postgresql.org/docs/11/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS and GET STACKED DIAGNOSTICS https://www.postgresql.org/docs/11/plpgsql-control-structures.html#PLPGSQL-EXCEPTION-DIAGNOSTICS are two different things. See the example here: https://www.postgresql.org/docs/11/plpgsql-control-structures.html#PLPGSQL-CALL-STACK > > However, I noticed, that the stack does not include the error place in > dynamic SQL executed by the "execute" command. Maybe I am missing > something again. > > Kind regards > > Thiemo > -- Adrian Klaver adrian.klaver@aklaver.com