* Returns true if at least one role is defined in this database cluster. */
| 1751 | * Returns true if at least one role is defined in this database cluster. |
| 1752 | */ |
| 1753 | static bool |
| 1754 | ThereIsAtLeastOneRole(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 | } |
no test coverage detected