Re: What hook would you recommend for "one time, post authentication"?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: What hook would you recommend for "one time, post authentication"?
Дата
Msg-id 18144.1383010032@sss.pgh.pa.us
обсуждение исходный текст
Ответ на What hook would you recommend for "one time, post authentication"?  (Daniel Farina <daniel@heroku.com>)
Ответы Re: What hook would you recommend for "one time, post authentication"?  (Daniel Farina <daniel@heroku.com>)
Список pgsql-hackers
Daniel Farina <daniel@heroku.com> writes:
> What hook would you recommend that matches this criteria:
> * Runs post-authentication

> * ..Once

ClientAuthentication_hook

> My general approach has been to try to use
> GetUserNameFromId(GetSessionUserId()), but this requires
> InitializeSessionUserId be called first, and that has been causing me
> some trouble.

So don't do that.  The HBA code uses 
roleid = get_role_oid(port->user_name, true);

and actually if you just want the string form you could use
port->user_name without any extra pushups (bearing in mind that
it might or might not be a valid user name).
        regards, tom lane



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: missing RelationCloseSmgr in FreeFakeRelcacheEntry?
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: ERROR : 'tuple concurrently updated'