diff --git a/src/backend/distributed/shared_library_init.c b/src/backend/distributed/shared_library_init.c index 1140991be..8ea60fe74 100644 --- a/src/backend/distributed/shared_library_init.c +++ b/src/backend/distributed/shared_library_init.c @@ -2498,7 +2498,11 @@ CitusAuthHook(Port *port, int status) /* - * IsSuperuser returns whether the role with the given name is superuser. + * IsSuperuser returns whether the role with the given name is superuser. If + * the user doesn't exist, this simply returns false instead of throwing an + * error. This is done to not leak information about users existing or not, in + * some cases postgres is vague about this on purpose. So, by returning false + * we let postgres return this possibly vague error message. */ static bool IsSuperuser(char *roleName) @@ -2511,9 +2515,7 @@ IsSuperuser(char *roleName) HeapTuple roleTuple = SearchSysCache1(AUTHNAME, CStringGetDatum(roleName)); if (!HeapTupleIsValid(roleTuple)) { - ereport(FATAL, - (errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION), - errmsg("role \"%s\" does not exist", roleName))); + return false; } Form_pg_authid rform = (Form_pg_authid) GETSTRUCT(roleTuple);