Re: [HACKERS] Trigger execution role

2012-03-06 Thread Dimitri Fontaine
Tom Lane writes: > This might be something to consider in the adjacent thread about command > triggers, too --- who do they run as, and if it's not the calling user, > how do they find out who that is? As of now, calling user (we just calling a function), or another user if the function is SECURI

Re: [HACKERS] Trigger execution role (was: Triggers with DO functionality)

2012-02-27 Thread Pavel Stehule
2012/2/28 Tom Lane : > Christopher Browne writes: >> On Mon, Feb 27, 2012 at 6:20 PM, Tom Lane wrote: >>> So, whatever the desirability of having them run as table owner, >>> we can't just up and change that. > >> I'm inclined to hold to the argument that it Works Properly Now, and >> that we sho

Re: [HACKERS] Trigger execution role (was: Triggers with DO functionality)

2012-02-27 Thread Alvaro Herrera
Excerpts from Tom Lane's message of lun feb 27 20:49:36 -0300 2012: > So (assuming Peter has read the spec correctly) I'm coming around to the > idea that the anonymous trigger functions created by this syntax ought > to be "SECURITY DEFINER table_owner". I don't remember all the details, but I

Re: [HACKERS] Trigger execution role (was: Triggers with DO functionality)

2012-02-27 Thread Tom Lane
Christopher Browne writes: > On Mon, Feb 27, 2012 at 6:20 PM, Tom Lane wrote: >> So, whatever the desirability of having them run as table owner, >> we can't just up and change that. > I'm inclined to hold to the argument that it Works Properly Now, and > that we shouldn't break it by changing i

Re: [HACKERS] Trigger execution role (was: Triggers with DO functionality)

2012-02-27 Thread Christopher Browne
On Mon, Feb 27, 2012 at 6:20 PM, Tom Lane wrote: > "Kevin Grittner" writes: >> As far as I can tell, triggers run as the user performing the >> operation which fires the trigger, not as the owner of the table. >  > Can anyone provide an example of a trigger running as the table >> owner?  Is ther

Re: [HACKERS] Trigger execution role (was: Triggers with DO functionality)

2012-02-27 Thread Tom Lane
"Kevin Grittner" writes: > As far as I can tell, triggers run as the user performing the > operation which fires the trigger, not as the owner of the table. > Can anyone provide an example of a trigger running as the table > owner? Is there a bug here? Something for the docs? A quick look into

Re: [HACKERS] Trigger execution role (was: Triggers with DO functionality)

2012-02-27 Thread Kevin Grittner
> Kevin Grittner wrote: >> Tom Lane wrote: >>> By default, a trigger function runs as the table owner, ie it's >>> implicitly SEC DEF to the table owner. >> >> Really? That's certainly what I would *want*, but it's not what >> I've seen. >> >> [self-contained example of that not happening] C