Postgresql – getting permission denied on an ownership change

amazon-rdspostgresqlpostgresql-9.4

My current user is pronto

mediapop_staging=> select current_user;
 current_user
--------------
 pronto
(1 row)

This user a standard super user created on AWS RDS.

mediapop_staging=> \du pronto
                        List of roles
 Role name |          Attributes           |    Member of
-----------+-------------------------------+-----------------
 pronto    | Create role, Create DB       +| {rds_superuser}
           | Password valid until infinity |

But I'm getting this:

mediapop_staging=> REASSIGN OWNED BY pronto TO mediapop_staging;
ERROR:  permission denied to reassign objects

Why? How can I resolve it?

Best Answer

There are some unintuitive permissions requirements when using REASSIGN without a superuser. See this other pots where I answered the same question: https://stackoverflow.com/a/62557497/79079