supautils icon indicating copy to clipboard operation
supautils copied to clipboard

Allow doing ALTER ROLE .. CONNECTION LIMIT on reserved roles

Open steve-chavez opened this issue 1 year ago • 3 comments

Problem

Currently gives an error:

alter role authenticator connection limit 30;

ERROR:  42501: "authenticator" is a reserved role, only superusers can modify it

This is useful for limiting pool connections.

Solution

Allow it.

steve-chavez avatar Feb 07 '24 20:02 steve-chavez

This needs to be more granular, otherwise you'd be able to alter role supabase_admin connection limit 0

soedirgo avatar Feb 19 '24 03:02 soedirgo

@soedirgo We have an undocumented (pending fix) feature that allows for configurable reserved roles by suffixing them with *, like authenticator here:

reserved_roles="supabase_storage_admin, anon, reserved_but_not_yet_created, authenticator*"

https://github.com/supabase/supautils/blob/master/nix/withTmpDb.sh.in#L18

That should clear your concern right?

steve-chavez avatar Feb 19 '24 15:02 steve-chavez

Hmm yeah, I think that'd work 👍

soedirgo avatar Feb 22 '24 09:02 soedirgo