I'm running Pg v7.3.4 I have a function where I need to determine the current user. But since the function was created with option "SECURITY DEFINER" (it has to be this way) current_user returns the name of creator, rather than current user. Is there a way in such function find out the real current user? Thanks, Mike.
> I'm running Pg v7.3.4 > I have a function where I need to determine the current user. > But since the function was created with option "SECURITY DEFINER" > (it has to be this way) current_user returns the name of creator, > rather than current user. > > Is there a way in such function find out the real current user? CURRENT_USER should be right. SESSION_USER is the username that connected to the DB. Look at table 6-27, session information functions: http://www.postgresql.org/docs/7.3/static/functions-misc.html -sc -- Sean Chittenden
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера