* Allocates storage for, and fills in, a new null-delimited string
* containing a formatted ACL specification. See aclparse for details.
*
+ * In bootstrap mode, this is called for debug printouts (initdb -d).
+ * We could ask bootstrap.c to provide an inverse of boot_get_role_oid(),
+ * but it seems at least as useful to just print numeric role OIDs.
+ *
* RETURNS:
* the new string
*/
if (aip->ai_grantee != ACL_ID_PUBLIC)
{
- htup = SearchSysCache1(AUTHOID, ObjectIdGetDatum(aip->ai_grantee));
+ if (!IsBootstrapProcessingMode())
+ htup = SearchSysCache1(AUTHOID, ObjectIdGetDatum(aip->ai_grantee));
+ else
+ htup = NULL;
if (HeapTupleIsValid(htup))
{
putid(p, NameStr(((Form_pg_authid) GETSTRUCT(htup))->rolname));
}
else
{
- /* Generate numeric OID if we don't find an entry */
+ /* No such entry, or bootstrap mode: print numeric OID */
sprintf(p, "%u", aip->ai_grantee);
}
}
*p++ = '/';
*p = '\0';
- htup = SearchSysCache1(AUTHOID, ObjectIdGetDatum(aip->ai_grantor));
+ if (!IsBootstrapProcessingMode())
+ htup = SearchSysCache1(AUTHOID, ObjectIdGetDatum(aip->ai_grantor));
+ else
+ htup = NULL;
if (HeapTupleIsValid(htup))
{
putid(p, NameStr(((Form_pg_authid) GETSTRUCT(htup))->rolname));
}
else
{
- /* Generate numeric OID if we don't find an entry */
+ /* No such entry, or bootstrap mode: print numeric OID */
sprintf(p, "%u", aip->ai_grantor);
}