When my postgres function is tries to create a new sequence, it returns a permission denied error. It looks like the only way to make it work is to give Create permission on schema using the below statement.

GRANT CREATE ON SCHEMA public to "myuser"

But, this will allow the user to create any other type of object as well, including tables. How can we control this? I want my user to be able to create a sequence, but not tables.

Note: Create is not a valid grant on Sequences.

1 Answer 1


There is no way to do this using permissions. The only option would be to create an event trigger that throws an exception if an undesirable object is created.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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