"Euler Taveira" <eu...@eulerto.com> writes: > On Fri, Sep 9, 2022, at 2:28 AM, bt22kawamotok wrote: >> is_superuser function checks whether a user is a superuser or not, and >> is commonly used. However, is_superuser is not documented and is set to >> UNGROUPED in guc.c. I think is_superuser should be added to the >> documentation and set to PRESET OPTIONS.What are you thought on this?
> There is no such function. Are you referring to the GUC? I agree that it > should > be added to the documentation. If you look at guc.c, it kind of seems intentional that it's undocumented: /* Not for general use --- used by SET SESSION AUTHORIZATION */ {"is_superuser", PGC_INTERNAL, UNGROUPED, gettext_noop("Shows whether the current user is a superuser."), NULL, GUC_REPORT | GUC_NO_SHOW_ALL | GUC_NO_RESET_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE }, &session_auth_is_superuser, false, NULL, NULL, NULL On the other hand, it seems pretty silly that it's GUC_REPORT if we want to consider it private. I've not checked the git history, but I bet that flag was added later with no thought about context. If we are going to document this then we should at least remove the GUC_NO_SHOW_ALL flag and rewrite the comment. I wonder whether the GUC_NO_RESET_ALL flag is needed either --- seems like the PGC_INTERNAL context protects it sufficiently. regards, tom lane