Re: pgsql: Add GET DIAGNOSTICS ... PG_CONTEXT in PL/PgSQL

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: pgsql: Add GET DIAGNOSTICS ... PG_CONTEXT in PL/PgSQL
Дата
Msg-id 20130725175415.GP15510@tamriel.snowman.net
обсуждение исходный текст
Ответ на Re: pgsql: Add GET DIAGNOSTICS ... PG_CONTEXT in PL/PgSQL  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: pgsql: Add GET DIAGNOSTICS ... PG_CONTEXT in PL/PgSQL  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-committers
Pavel,

First, please only quote the relevant parts of the email when
responding.

* Pavel Stehule (pavel.stehule@gmail.com) wrote:
> I used a ErrorContext because I wasn't sure so errcontext and similar
> function can work in different context. Now I look there and there
> should be well initialized ErrorDataStack, due
>
> int
> set_errcontext_domain(const char *domain)
> {
> <------>ErrorData  *edata = &errordata[errordata_stack_depth];
>
> <------>/* we don't bother incrementing recursion_depth */
> <------>CHECK_STACK_DEPTH();
>
> <------>edata->context_domain = domain;
>
> <------>return 0;
> }
>
> but MemoryContext can be any - so probably some private context is ideal.

While set_errcontext_domain() doesn't care about the MemoryContext, per
se, the errcontext() macro further calls errcontext_msg() which is
currently set up to explicitly use ErrorContext.  Perhaps an elog.c
global to tell errcontext_msg() to not switch memory contexts, but what
happens if there's an error thrown by a callback function..?

    Thanks,

        Stephen

Вложения

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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: pgsql: Add GET DIAGNOSTICS ... PG_CONTEXT in PL/PgSQL
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pgsql: Add GET DIAGNOSTICS ... PG_CONTEXT in PL/PgSQL