Running function as superuser

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ildiff
    New Member
    • Sep 2008
    • 2

    Running function as superuser

    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?
  • rski
    Recognized Expert Contributor
    • Dec 2006
    • 700

    #2
    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.

    Comment

    • ildiff
      New Member
      • Sep 2008
      • 2

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

      Comment

      Working...