0

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?

2 Answers 2

1

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

The documentation 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 Section 22.3.)

0

You can only do that when you are logged in as the owner of the table. You'll be able to use DDL commands once you are logged in as the owner of the table.

1
  • This site works differently and this adds nothing new. Commented Oct 26, 2023 at 13:06

Your Answer

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

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