Обсуждение: BUG #8212: Feature request: View original value of current_user in function with SECURITY DEFINER set

Поиск
Список
Период
Сортировка

BUG #8212: Feature request: View original value of current_user in function with SECURITY DEFINER set

От
geoff.montee@gmail.com
Дата:
The following bug has been logged on the website:

Bug reference:      8212
Logged by:          Geoff Montee
Email address:      geoff.montee@gmail.com
PostgreSQL version: 9.2.4
Operating system:   Linux
Description:        =


When a user calls a function that has SECURITY DEFINER set, the value of
"current_user" is changed to the name of the role that defined the
function.

For some use cases, it would be useful to be able to obtain the original
value of "current_user" from within the function. Specifically, this would
make sense in trigger functions used for auditing, where recording only
session_user may not be sufficient.