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?
Sébastien ClémentSébastien Clément
asked Oct 12, 2021 at 17:02
1 Answer 1
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
-
2CREATE privilege on the schema for the target role was the culprit, it now works, many thanks!Sébastien Clément– Sébastien Clément2021年10月12日 21:48:03 +00:00Commented 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.user1822– user18222021年10月14日 05:07:03 +00:00Commented Oct 14, 2021 at 5:07
lang-sql