Re: SYSTEM_USER reserved word implementation

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: SYSTEM_USER reserved word implementation
Дата
Msg-id YwgboqQUV1+Y/k6z@paquier.xyz
обсуждение исходный текст
Ответ на Re: SYSTEM_USER reserved word implementation  ("Drouvot, Bertrand" <bdrouvot@amazon.com>)
Ответы Re: SYSTEM_USER reserved word implementation
Re: SYSTEM_USER reserved word implementation
Список pgsql-hackers
On Thu, Aug 25, 2022 at 08:21:05PM +0200, Drouvot, Bertrand wrote:
> system_user() now returns a text and I moved it to miscinit.c in the new
> version attached (I think it makes more sense now).

+/* kluge to avoid including libpq/libpq-be.h here */
+struct ClientConnectionInfo;
+extern void InitializeSystemUser(struct ClientConnectionInfo conninfo);
+extern const char* GetSystemUser(void);

FWIW, I was also wondering about the need for all this initialization
stanza and the extra SystemUser in TopMemoryContext.  Now that we have
MyClientConnectionInfo, I was thinking to just build the string in the
SQL function as that's the only code path that needs to know about
it.  True that this approach saves some extra palloc() calls each time
the function is called.

> New version attached is also addressing Michael's remark regarding the peer
> authentication TAP test.

Thanks.  I've wanted some basic tests for the peer authentication for
some time now, independently on this thread, so it would make sense to
split that into a first patch and stress the buildfarm to see what
happens, then add these tests for SYSTEM_USER on top of the new test.
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: pg_receivewal and SIGTERM
Следующее
От: Shinya Kato
Дата:
Сообщение: Fix japanese translation of log messages