MCPcopy Create free account
hub / github.com/apache/cloudberry / ThereIsAtLeastOneRole

Function ThereIsAtLeastOneRole

src/backend/utils/init/postinit.c:1753–1769  ·  view source on GitHub ↗

* Returns true if at least one role is defined in this database cluster. */

Source from the content-addressed store, hash-verified

1751 * Returns true if at least one role is defined in this database cluster.
1752 */
1753static bool
1754ThereIsAtLeastOneRole(void)
1755{
1756 Relation pg_authid_rel;
1757 TableScanDesc scan;
1758 bool result;
1759
1760 pg_authid_rel = table_open(AuthIdRelationId, AccessShareLock);
1761
1762 scan = table_beginscan_catalog(pg_authid_rel, 0, NULL);
1763 result = (heap_getnext(scan, ForwardScanDirection) != NULL);
1764
1765 table_endscan(scan);
1766 table_close(pg_authid_rel, AccessShareLock);
1767
1768 return result;
1769}

Callers 1

InitPostgresFunction · 0.85

Calls 5

table_openFunction · 0.85
table_beginscan_catalogFunction · 0.85
heap_getnextFunction · 0.85
table_endscanFunction · 0.85
table_closeFunction · 0.85

Tested by

no test coverage detected