(curs, tbl)
return len(tmp) > 0
Does temp table exists?
Does temp table exists?
Does temp table exists?
def exists_temp_table(curs, tbl):
    """Does temp table exists?"""
    # correct way, works only on 8.2
    q = "select 1 from pg_class where relname = %s and relnamespace = pg_my_temp_schema()"
    curs.execute(q, [tbl])
    tmp = curs.fetchall()
    return len(tmp) > 0
def exists_temp_table ( curs , tbl ) : # correct way, works only on 8.2 q = "select 1 from pg_class where relname = %s and relnamespace = pg_my_temp_schema()" curs . execute ( q , [ tbl ] ) tmp = curs . fetchall ( ) return len ( tmp ) > 0