Generate the SQL required for specific object type

def _make_default_privileges_list_query(name, object_type, prepend):
    '''
    Generate the SQL required for specific object type
    '''
    if object_type == 'table':
        query = (' '.join([
            'SELECT defacl.defaclacl AS name',
            'FROM pg_default_acl defacl',
            'JOIN pg_authid aid',
            'ON defacl.defaclrole = aid.oid ',
            'JOIN pg_namespace nsp ',
            'ON nsp.oid = defacl.defaclnamespace',
            "WHERE nsp.nspname = '{0}'",
            "AND defaclobjtype ='r'",
            'ORDER BY nspname',
        ])).format(prepend)
    elif object_type == 'sequence':
        query = (' '.join([
            'SELECT defacl.defaclacl AS name',
            'FROM pg_default_acl defacl',
            'JOIN pg_authid aid',
            'ON defacl.defaclrole = aid.oid ',
            'JOIN pg_namespace nsp ',
            'ON nsp.oid = defacl.defaclnamespace',
            "WHERE nsp.nspname = '{0}'",
            "AND defaclobjtype ='S'",
            'ORDER BY nspname',
        ])).format(prepend, name)
    elif object_type == 'schema':
        query = (' '.join([
            'SELECT nspacl AS name',
            'FROM pg_catalog.pg_namespace',
            "WHERE nspname = '{0}'",
            'ORDER BY nspname',
        ])).format(name)
    elif object_type == 'function':
        query = (' '.join([
            'SELECT defacl.defaclacl AS name',
            'FROM pg_default_acl defacl',
            'JOIN pg_authid aid',
            'ON defacl.defaclrole = aid.oid ',
            'JOIN pg_namespace nsp ',
            'ON nsp.oid = defacl.defaclnamespace',
            "WHERE nsp.nspname = '{0}'",
            "AND defaclobjtype ='f'",
            'ORDER BY nspname',
        ])).format(prepend, name)
    elif object_type == 'group':
        query = (' '.join([
            'SELECT rolname, admin_option',
            'FROM pg_catalog.pg_auth_members m',
            'JOIN pg_catalog.pg_roles r',
            'ON m.member=r.oid',
            'WHERE m.roleid IN',
            '(SELECT oid',
            'FROM pg_catalog.pg_roles',
            "WHERE rolname='{0}')",
            'ORDER BY rolname',
        ])).format(name)

    return query