Re: Restore CurrentUserId only if 'prevUser' is valid when aborttransaction

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Restore CurrentUserId only if 'prevUser' is valid when aborttransaction
Дата
Msg-id 20181023054030.GD1658@paquier.xyz
обсуждение исходный текст
Ответ на Re: Restore CurrentUserId only if 'prevUser' is valid when abort transaction  (Richard Guo <riguo@pivotal.io>)
Ответы Re: Restore CurrentUserId only if 'prevUser' is valid when aborttransaction
Список pgsql-hackers
On Fri, Oct 12, 2018 at 02:28:36PM +0800, Richard Guo wrote:
> I think it is a better idea to avoid adjusting the state to TRANS_INPROGRESS
> from TRANS_START when aborting a transaction, as your patch does, since its
> only purpose is to suppress warning message.

Actually, as StartSubTransaction also switches to TRANS_START for a
savepoint, if there is an error until the state is switched to
TRANS_INPROGRESS then the code would fail to switch back to
CurrentUserId even if it is set, and it should be switched.  So that
solution is not correct either as AtSubStart_ResourceOwner() or such
could fail on memory allocation.  That's unlikely going to happen, but
it could.
--
Michael

Вложения

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

Предыдущее
От: "Tsunakawa, Takayuki"
Дата:
Сообщение: RE: WAL archive (archive_mode = always) ?
Следующее
От: Dilip Kumar
Дата:
Сообщение: Re: Side effect of CVE-2017-7484 fix?