(curs, type_name)
return res[0]
Does type exists?
Does type exists?
Does type exists?
def exists_type(curs, type_name):
    """Does type exists?"""
    schema, name = fq_name_parts(type_name)
    q = """select count(1) from pg_namespace n, pg_type t
           where t.typnamespace = n.oid
             and n.nspname = %s and t.typname = %s"""
    curs.execute(q, [schema, name])
    res = curs.fetchone()
    return res[0]
def exists_type ( curs , type_name ) : schema , name = fq_name_parts ( type_name ) q = """select count(1) from pg_namespace n, pg_type t
           where t.typnamespace = n.oid
             and n.nspname = %s and t.typname = %s""" curs . execute ( q , [ schema , name ] ) res = curs . fetchone ( ) return res [ 0 ]