Thread: only one namespace allowed by a authid at pg_namespace table?

only one namespace allowed by a authid at pg_namespace table?

From
sunpeng
Date:
only one namespace allowed by a authid at pg_namespace table? for in the function:
static void recomputeNamespacePath(void){
...
if (strcmp(curname, "$user") == 0)
        {
            /* $user --- substitute namespace matching user name, if any */
            HeapTuple    tuple;

            tuple = SearchSysCache(AUTHOID,
                                   ObjectIdGetDatum(roleid),
                                   0, 0, 0);
            if (HeapTupleIsValid(tuple))
            {
                char       *rname;

                rname = NameStr(((Form_pg_authid) GETSTRUCT(tuple))->rolname);
                namespaceId = GetSysCacheOid(NAMESPACENAME,
                                             CStringGetDatum(rname),
                                             0, 0, 0);
                ReleaseSysCache(tuple);
                if (OidIsValid(namespaceId) &&
                    !list_member_oid(oidlist, namespaceId) &&
                    pg_namespace_aclcheck(namespaceId, roleid,
                                          ACL_USAGE) == ACLCHECK_OK)
                    oidlist = lappend_oid(oidlist, namespaceId);
            }
        }
}
...
}
I noticed with the revoke of function GetSysCacheOid(NAMESPACENAME, CStringGetDatum(rname),0, 0, 0); only return one oid of namespace.