Re: Schema variables - new implementation for Postgres 15

Поиск
Список
Период
Сортировка
От Julien Rouhaud
Тема Re: Schema variables - new implementation for Postgres 15
Дата
Msg-id 20230812012819.k5gu4r4kzdiq6r3f@jrouhaud
обсуждение исходный текст
Ответ на Re: Schema variables - new implementation for Postgres 15  (Dmitry Dolgov <9erthalion6@gmail.com>)
Ответы Re: Schema variables - new implementation for Postgres 15
Список pgsql-hackers
On Fri, Aug 11, 2023 at 05:55:26PM +0200, Dmitry Dolgov wrote:
>
> Another confusing example was this one at the end of set_session_variable:
>
>     +    /*
>     +     * XXX While unlikely, an error here is possible. It wouldn't leak memory
>     +     * as the allocated chunk has already been correctly assigned to the
>     +     * session variable, but would contradict this function contract, which is
>     +     * that this function should either succeed or leave the current value
>     +     * untouched.
>     +     */
>     +    elog(DEBUG1, "session variable \"%s.%s\" (oid:%u) has new value",
>     +         get_namespace_name(get_session_variable_namespace(svar->varid)),
>     +         get_session_variable_name(svar->varid),
>     +         svar->varid);
>
> It's not clear, which exactly error you're talking about, it's the last
> instruction in the function.

FTR I think I'm the one that changed that.  The error I was talking about is
elog() itself (in case of OOM for instance), or even one of the get_* call, if
running with log_level <= DEBUG1.  It's clearly really unlikely but still
possible, thus this comment which also tries to explain why this elog() is not
done earlier.



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: run pgindent on a regular basis / scripted manner
Следующее
От: Jeff Davis
Дата:
Сообщение: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION }