def query_schema_existence(conn, schema_name):
    'Function to verify whether the current database schema ownership is correct.'
    with conn.cursor() as cur:
        cur.execute('SELECT EXISTS(SELECT 1 FROM information_schema.schemata WHERE SCHEMA_NAME = %s)', [schema_name])
        return cur.fetchone().exists
Function to verify whether the current database schema ownership is correct.
def query_schema_existence(conn, schema_name):
    
    with conn.cursor() as cur:
        cur.execute('SELECT EXISTS(SELECT 1 FROM information_schema.schemata WHERE SCHEMA_NAME = %s)', [schema_name])
        return cur.fetchone().exists