Grant All on All tabes in schema?



  • I have a question about grants...

    I ran the following command, assuming it would allow me to make any changes to the tables in the public schema:

    grant all on all tables in schema public to User1;
    

    However, when I try to add a new column I still get the error message below:

    ERROR:  must be owner of table Tab1
    

    I guess I'm just a little misinformed on the purpose of the grant all on all command, and how can I refine this to allow a user to add columns to a table without changing ownership?



  • Right. You cannot GRANT the right to ALTER or DROP a table. Only the table owner or a superuser can do that.

    https://www.postgresql.org/docs/current/ddl-priv.html describes that:

    The right to modify or destroy an object is inherent in being the object's owner, and cannot be granted or revoked in itself. (However, like all privileges, that right can be inherited by members of the owning role; see https://www.postgresql.org/docs/current/role-membership.html )



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2