ERROR: must be a member of the PostgreSQL role


I need to change the owner of the table.
I created a table:

CREATE TABLE example (some columns); 

Then I tried to change the owner:

 ALTER TABLE database.expample OWNER TO "secondary"; 

and them i got this error:

 ERROR: must be member of role "secondary" 

Can someone help me?
Thanks in advance.

+5
source share
1 answer

See this from the Postgresql documentation:

http://www.postgresql.org/docs/current/static/sql-altertable.html

You must use a table to use ALTER TABLE. To modify the table schema, you must also have the CREATE privilege for the new schema. To change the owner, you must also be a direct or indirect member of the new one and this role must have CREATE privileges for the schema table. (These restrictions provide that changing the owner does not do everything you could not do by resetting and re-creating the table. However, the superuser can in any case change the ownership of any table.)

+4
source

All Articles