Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Given I am a root user X. I have users A and B.

How do I GRANT user A to enable him granting user B to execute a specific set of functions?

For example we have user A that owns database_1. User A creates some stored functions on this DB (say, function_a and function_b). User A should be able grant execution of that functions to user B, and only to him.

share|improve this question
up vote 2 down vote accepted

By default, an object's owner has ALL PRIVILEGES on that object, but I don't recall specifically whether those privileges extend to allowing a normal (non-super) user to GRANT permissions on that object to other users.

In any case, you should be able to give that ability to a user by appending the WITH GRANT OPTION clause to a GRANT statement. (I refer you to the docs for full details.)

For example, in your hypothetical scenario, as superuser X, you could do something like this:


User A would then have the power to GRANT permissions on objects in database_1 to other users. Continuing the hypothetical example, user A could give specific permissions to user B, like this:

GRANT EXECUTE  ON FUNCTION function_a(), function_b()  TO B;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.