Connecting Tech Pros Worldwide Forums | Help | Site Map

Running function as superuser

Newbie
 
Join Date: Sep 2008
Posts: 2
#1: Sep 17 '08
How I can run a function written in plpgsql as superuser when I'm logged into the database as normal user with a restrict access to tables?

Moderator
 
Join Date: Dec 2006
Location: Europe
Posts: 292
#2: Sep 17 '08

re: Running function as superuser


1) you can set your role to admin and run a function (if you have enough strong privileges)
2) you can create this function from admin account with SECURE DEFINER option. Everybody would run this functions with admin rights.
Newbie
 
Join Date: Sep 2008
Posts: 2
#3: Sep 17 '08

re: Running function as superuser


Problem solved with the security definer. Thanks a lot rski!
Reply