Postgres::getRoles PHP Method

getRoles() public method

Returns all roles in the database cluster
public getRoles ( $rolename = '' ) : All
$rolename (optional) The role name to exclude from the select
return All roles
    function getRoles($rolename = '')
    {
        $sql = '
			SELECT rolname, rolsuper, rolcreatedb, rolcreaterole, rolinherit,
				rolcanlogin, rolconnlimit, rolvaliduntil, rolconfig
			FROM pg_catalog.pg_roles';
        if ($rolename) {
            $sql .= " WHERE rolname!='{$rolename}'";
        }
        $sql .= ' ORDER BY rolname';
        return $this->selectSet($sql);
    }
Postgres