pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Thiemo Kellner <thiemo@gelassene-pferde.biz>
To: PostgreSQL General <pgsql-general@lists.postgresql.org>
Subject: Re: Use of ?get diagnostics'?
Date: Thu, 26 Sep 2019 06:35:30 -0700
Message-ID: <af25493a-7fd3-2ee4-5416-347c8b822ef8@aklaver.com> (raw)
In-Reply-To: <20190926054418.Horde.JG3i7Er5VDQBFQF4uEfhCVR@webmail.gelassene-pferde.biz>
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>

On 9/25/19 10:44 PM, Thiemo Kellner wrote:
> Hello Adrian
> 
> Quoting Adrian Klaver <adrian.klaver@aklaver.com>:
> 
>> 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





view thread (6+ messages)

Message-ID: <af25493a-7fd3-2ee4-5416-347c8b822ef8@aklaver.com>
Permalink:  ../af25493a-7fd3-2ee4-5416-347c8b822ef8@aklaver.com/
Also on:    postgresql.org/message-id/af25493a-7fd3-2ee4-5416-347c8b822ef8@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, thiemo@gelassene-pferde.biz
  Subject: Re: Use of ?get diagnostics'?
  In-Reply-To: <af25493a-7fd3-2ee4-5416-347c8b822ef8@aklaver.com>
  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> <af25493a-7fd3-2ee4-5416-347c8b822ef8@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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