Re: Use of ?get diagnostics'?

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Use of ?get diagnostics'?
Дата
Msg-id af25493a-7fd3-2ee4-5416-347c8b822ef8@aklaver.com
обсуждение исходный текст
Ответ на Re: Use of ?get diagnostics'?  (Thiemo Kellner <thiemo@gelassene-pferde.biz>)
Список pgsql-general
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



В списке pgsql-general по дате отправления:

Предыдущее
От: Rob Sargent
Дата:
Сообщение: Re: managing primary key conflicts while restoring data to table with existing data
Следующее
От: Krishnakant Mane
Дата:
Сообщение: Re: managing primary key conflicts while restoring data to table withexisting data