All Products
Search
Document Center

ApsaraDB RDS:What do I do if the "must be owner of xxx" error message is displayed when I execute the CREATE CAST statement on my ApsaraDB RDS for PostgreSQL instance?

Last Updated:Aug 24, 2023

This topic describes how to resolve the issue that the must be owner of type xx or type xxx error message is displayed when you execute the CREATE CAST statement on your ApsaraDB RDS for PostgreSQL instance to convert data types.

Problem description

The ERROR: must be owner of type xxx or type xxx error message is displayed when I execute the CREATE CAST statement on my RDS instance to convert data types.

Example statement:
CREATE cast(boolean AS smallint) WITH INOUT AS implicit;

Solution

Important Your RDS instance must meet the following requirements before you can use this solution to resolve the issue:
  • The major engine version of your RDS instance is PostgreSQL 10, PostgreSQL 11, PostgreSQL 12, PostgreSQL 13, or PostgreSQL 14.
  • The minor engine version of your RDS instance is 20210531 or later. For more information about how to view and update the minor engine version of your RDS instance, see Update the minor engine version of an ApsaraDB RDS for MySQL instance.
Perform the following steps to resolve the issue that occurs when you execute the preceding sample statement:
  1. Use a privileged account to connect your application to the database. For more information about how to obtain a privileged account, see Create an account on an ApsaraDB RDS for PostgreSQL instance.
  2. Change the owner of the data type to the current logon account before the conversion.
    ALTER type bool owner TO <your role>;
  3. Execute the CREATE CAST statement again to convert the data type.
    CREATE cast(boolean AS smallint) WITH INOUT AS implicit;