Re: [GENERAL] How to get an exception detail in a function called inexception handler

Поиск
Список
Период
Сортировка
От Shakti Singh
Тема Re: [GENERAL] How to get an exception detail in a function called inexception handler
Дата
Msg-id CAH19PkkhipBTYQDzANXXi3qxj5ucov--5d0uWuAAumTPsHAmCg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [GENERAL] How to get an exception detail in a function called in exception handler  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Thanks for the reply Tom!

The log_error_function is being called by thousands of functions and that is why I thought it would be great if there was a way without making changes to it and subsequently writing code to pass the parameters in all these exception block.

Would have been awesome if error logging function could get the previous exception details somehow.

Thanks,


Shakti Singh


On Tue, Jan 24, 2017 at 11:13 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Shakti Singh <shakti.0123@gmail.com> writes:
> In oracle sqlcode and sqlerrm can be accessed in a function called from an
> exception block.
> How do I do this in PostgreSQL

In PG those are local variables within an exception block.  You'd have to
pass their values to the error-logging function explicitly.

                        regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] How to get an exception detail in a function called in exception handler
Следующее
От: Joshua Chamberlain
Дата:
Сообщение: Re: [GENERAL] Why is materialized view creation a "security-restrictedoperation"?