Re: User permission
От
Tom Lane
Тема
Re: User permission
Дата
Msg-id
22542.1082074122@sss.pgh.pa.us
Ответ на
User permission (C G)
Список
Дерево обсуждения
User permission "C G" <csgcsg39@hotmail.com>
Re: User permission Tom Lane <tgl@sss.pgh.pa.us>
Re: User permission Peter Eisentraut <peter_e@gmx.net>
"C G" writes: > I have a user_info table that has trigger which creates a user and > switches session authorization to the new user, but it doesn't seem to > work as I expect. > mydb1=> select * from user_info ; > usename | password > ---------+---------- > user1 | *** > (1 row) > Shouldn't be able to do that! I think what is happening is that when control exits from the SECURITY DEFINER function, the value of current_user is reset to what it was when the function was entered. So even though session_user says user1, you are still effectively admin here. I'm not sure there is any clean solution that would make this do what you expect, partly because it's not real clear what you expect (consider nested SECURITY DEFINER functions, error recovery, etc). I'd be inclined to put a band-aid on it by forbidding SET SESSION AUTHORIZATION inside functions. Can anyone propose a defensible and implementable behavior that would allow CG to do what he wants? regards, tom lane
В списке pgsql-general по дате отправления
От: Tom Lane
Дата:
От: jseymour@LinxNet.com (Jim Seymour)
Дата: