5

I am trying to change the ownership of a table for which I am already the owner. I am also the owner of the database and have the CREATE and USAGE privileges on the PUBLIC schema. I get the following error message:

ts_d=> ALTER TABLE table1 OWNER TO user2;
ERROR: permission denied for schema public

How to change ownership without logging as superuser?

asked Oct 12, 2021 at 17:02

1 Answer 1

8

You must be a member of both the old and the new owning role, and the target role needs the CREATE privilege on the schema.

answered Oct 12, 2021 at 20:24
2
  • 2
    CREATE privilege on the schema for the target role was the culprit, it now works, many thanks! Commented Oct 12, 2021 at 21:48
  • @SébastienClément If that answer solved your question then you should accept it, so that your question is marked as resolved. Commented Oct 14, 2021 at 5:07

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.