The owner of my schema – public is called ‘eyal‘, and the owner of the tabled inside the schema, called ‘postgres‘.
I am trying to change my table owner (when im logged to user: ‘eyal‘) to user: ‘eyal‘ but i get the error – "must be owner of the table"
How is it possible to be an owner of a schema, but without the ability to change the schema tables owners?
I tryed using the following commands:
ALTER TABLE public.table_name OWNER TO "eyal";
&
GRANT ALL PRIVILEGES
ON ALL TABLES IN SCHEMA "public"
TO "eyal";
but nothing works.
2
Answers
The documentation describes this:
The alternative is that you are a superuser, who can do anything.
https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PRIV
So it’s like you as schema owner (eyal) granted create and usage privileges to
another user (postgres) then (postgres) is the table owner.
Also https://www.postgresql.org/docs/12/ddl-priv.html#PRIVILEGE-ABBREVS-TABLE
Schema only have two privileges: USAGE and CREATE. So as a schema owner, you can only apply these two privileges to other roles.