Open
Description
Problem
On pg 15 and lower https://www.postgresql.org/docs/15/sql-createrole.html
You must be a superuser to create a new role having the BYPASSRLS attribute.
For pg 16 and up https://www.postgresql.org/docs/16/sql-createrole.html
Only superuser roles or roles with BYPASSRLS can specify BYPASSRLS.
Currently supautils has custom code for granting BYPASSRLS via privileged_role
, which internally we turn into superuser.. but this is no longer necessary.
Solution
Disable the BYPASSRLS feature with privileged_role for pg >= 16. Doing ALTER ROLE privileged_role BYPASSRLS
is enough for allowing granting BYPASSRLS to other roles.
cc @soedirgo