2

is it possible to allow a user to create sequences in a schema without allowing him to create tables, functions, stored procedures, etc?

This is my current set of SQL commands so far:

   REVOKE ALL ON SCHEMA sales FROM sales_user;
   REVOKE ALL ON ALL TABLES IN SCHEMA sales FROM sales_user;
   REVOKE ALL ON ALL SEQUENCES IN SCHEMA sales FROM sales_user;
   REVOKE ALL ON ALL FUNCTIONS IN SCHEMA sales FROM sales_user;

   GRANT USAGE ON SCHEMA sales TO sales_user;
   GRANT SELECT, INSERT, UPDATE ON ALL TABLES IN SCHEMA sales TO sales_user;
   GRANT SELECT, UPDATE ON ALL SEQUENCES IN SCHEMA sales TO sales_user;
>> GRANT CREATE ON ALL SEQUENCES IN SCHEMA sales TO sales_user;
   GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA sales TO sales_user;

Everything works well, but the line that is marked generates

ERROR:  invalid privilege type CREATE for sequence

Thanks.

1 Answer 1

4

There is no privilege in PostgreSQL that grants or denies the creation of certain objects.

All you need is the CREATE privilege on a schema, then you can create anything you want in that schema.

So there is no way to achieve what you want.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.