I dont believe that there is a maximum site role name in postgresql. There is minimum_site_role in the Groups table as we see in the data dictionary below:
Do you have Alteryx? I have a workflow that solves this (although we don't use guest logins)... and if you don't have it I guess you could use a trial license
My workflow is undocumented, but it should help
Andrew Bui from I have seen this is not possible from the Postgres DB. However, it can be done through the API. Take a look at this Powershell script. If this reply is helpful please mark it as such.
CC: Fiona Gordon