@classmethod
def list(cls, ignore=()):
    """Query to list all users."""
    statement = (
        "SELECT usename, datname, pg_encoding_to_char(encoding), datcollate FROM pg_catalog.pg_user LEFT JOIN pg_catalog.pg_database ON CONCAT(usename, '=CTc/os_admin') = ANY(datacl::text[]) WHERE (datistemplate ISNULL OR datistemplate = false)"
        )
    if ignore:
        for name in ignore:
            statement += " AND usename != '{name}'".format(name=name)
    return statement
