Help Center > > FAQs> Database Permission> Why Is An Error Reported When I Attempt to Change a Table Owner of the RDS for PostgreSQL Database?

Why Is An Error Reported When I Attempt to Change a Table Owner of the RDS for PostgreSQL Database?

Updated at: Jun 09, 2021 GMT+08:00

Symptom

An error is reported when the owner of the PostgreSQL database table mytable is being changed to user test. The PostgreSQL database is named my_db and created by user root.

ALTER TABLE mytable OWNER TO test;

Possible Causes

The error is displayed because user root has not escalated the privilege.

After the privilege is escalated, user root has the permission to assign the table owner to another user.

Solution

  1. Log in to the database as user test.
  2. Run the following command as user test:

    GRANT test TO root;

  3. Log in to the database as user root.
  4. Run the following command as user root to change the owner of the mytable table:

    ALTER TABLE mytable OWNER TO test;

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel