Re: Assertion failure on reload of GUC_SUPERUSER_ONLY parms

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Assertion failure on reload of GUC_SUPERUSER_ONLY parms
Дата
Msg-id 1020.1254585261@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Assertion failure on reload of GUC_SUPERUSER_ONLY parms  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-bugs
Simon Riggs <simon@2ndQuadrant.com> writes:
> It looks to me like the correct fix would be to use
> GetUserIdAndContext() instead, though I would suggest inventing
> GetUserIdIfAny() which would skip the assertion test for use in
> superuser().

You are thinking at the wrong abstraction level.  Even to ask if
the user is superuser is inappropriate in the postmaster, since
there is no user.  So I think the bug is that GetConfigOption
is calling superuser() when it is now possible for it to be used
in the postmaster.

The quick & dirty fix would be to add IsUnderPostmaster to the
check in GetConfigOption.  Or we could refactor things so that
the GUC_SUPERUSER_ONLY check is applied at some higher level;
but that's probably more work than it's worth.

It looks to me like the pstrdup that was added in guc-file.l
represents a permanent memory leak in the postmaster, too :-(

            regards, tom lane

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Assertion failure on reload of GUC_SUPERUSER_ONLY parms
Следующее
От: Robert Haas
Дата:
Сообщение: Re: BUG #5083: Problem create account.