On Mon, 2004-09-06 at 09:23, Philippe Lang wrote:
> Hello,
> 
> Dropping a trigger is permitted if the user is the owner of the table
> for which the trigger is defined.
> 
> In a plpgsql function, used by different users, I need to disable some
> triggers for a short period of time. With the pgsql user login, I can
> succesfully drop and create the trigger again (after locking the tables
> for which I drop triggers), but unfortunately this not possible with a
> different user login, since they are not the owner of the table.
> 
> What could I do in this situation?

Create another function to do the job and call it from inside your
plpgsql function.  The second function should be created by the user
that owns the table and should be created with the SECURITY DEFINER
option so that it will run with the permissions of the user that created
it rather than those of the user invoking it.

-- 
Oliver Elphick                                          [EMAIL PROTECTED]
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0 5664 7A2F A543 10EA
                 ========================================
     "Behold, I stand at the door, and knock; if any man 
      hear my voice, and open the door, I will come in to 
      him, and will sup with him, and he with me."       
                                   Revelation 3:20 


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to