fetch data from database (use zone_id if not empty/None) and print to
    console

def print_data(zone_id, connection):
    """fetch data from database (use zone_id if not empty/None) and print to
    console"""
    result = connection.execute(
        # explicitly pass zone id before related data
        select([cast(zone_id.encode('utf-8'), BYTEA), test_table]))
    result = result.fetchall()
    ZONE_ID_INDEX = 0
    print("use zone_id: ", zone_id)
    print("{:<3} - {} - {} - {}".format("id", 'zone', "data", "raw_data"))
    for row in result:
        print(
            "{:<3} - {} - {} - {}\n".format(
            row['id'], row[ZONE_ID_INDEX].decode('utf-8'),
            row['data'].decode('utf-8', errors='ignore'), row['raw_data']))