ALTER ROLE BYPASSRLS permission denied on Flexible Server - cannot restore attribute after accidental NOBYPASSRLS

Christian Guerrero 0 Puntos de reputación
2026-05-29T05:07:39.4733333+00:00

Problem:
I accidentally ran the following command on my admin role.

Now I need to restore the BYPASSRLS attribute, but when I try to run: ALTER ROLE {name} BYPASSRLS;

I get this error: SQL Error [42501]: ERROR: permission denied to alter role Detail: Only roles with the BYPASSRLS, CREATEROLE attribute and ADMIN option on role "guerreros" may alter the BYPASSRLS attribute for this role. The issue is a chicken-and-egg situation: to grant BYPASSRLS, the executing role must already have BYPASSRLS, but "guerreros" was the only role with that attribute, and I just removed it from itself. On Flexible Server I don't have access to a real superuser, so no available role can re-grant it.

Question: How can I restore the BYPASSRLS attribute on my admin role "guerreros"? Is there a way to do this myself, or does this require a support engineer to run it with superuser privileges on the backend?

Azure Database para PostgreSQL
Azure Database para PostgreSQL

Servicio de base de datos PostgreSQL administrado por Azure para el desarrollo y la implementación de aplicaciones.


Su respuesta

Las respuestas pueden ser marcadas como Respuestas aceptadas por el autor de la pregunta, lo que indica a los usuarios que la respuesta resolvió su problema.