Create Sequence Permission for Postgres
carriann last edited by
When my postgres function is tries to create a new sequence, it returns a
permission deniederror. It looks like the only way to make it work is to give
Create permissionon 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.
There is no way to do this using permissions. The only option would be to create an https://www.postgresql.org/docs/current/event-triggers.html that throws an exception if an undesirable object is created.