'Postgresql ALTER FUNCTION hanging

I'm trying to ALTER the owner of a FUNCTION and add a GRANT but it seems to be hanging for ever on the first command. This is what I'm running...

SET ROLE postgres; BEGIN;
ALTER FUNCTION foo(args) OWNER TO role_one;
GRANT EXECUTE ON FUNCTION foo TO role_two;
COMMIT; RESET ROLE;

Is there a chance a previous attempt has caused a lock on the function? If so, how can I remove that lock?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source