(curs, view_name)
return res[0]
Does view exists?
Does view exists?
Does view exists?
def exists_view(curs, view_name):
    """Does view exists?"""
    schema, name = fq_name_parts(view_name)
    q = """select count(1) from pg_namespace n, pg_class c
           where c.relnamespace = n.oid and c.relkind = 'v'
             and n.nspname = %s and c.relname = %s"""
    curs.execute(q, [schema, name])
    res = curs.fetchone()
    return res[0]
def exists_view ( curs , view_name ) : schema , name = fq_name_parts ( view_name ) q = """select count(1) from pg_namespace n, pg_class c
           where c.relnamespace = n.oid and c.relkind = 'v'
             and n.nspname = %s and c.relname = %s""" curs . execute ( q , [ schema , name ] ) res = curs . fetchone ( ) return res [ 0 ]