I have two users running on my databse, the "superuser" and then "readonly" user.
If I log into the database as "readonly" I am not able to use "set role" and "set authorization" as expected.
However if I log into the database as "superuser" and then switch to "readonly", I am able to execute these commands and then switch back to "supeuser"
Is this kind of behavior intended? If so, can it be restricted?
Best regards.
Yes, that behavior is intended, and you cannot restrict it.