def METHOD_NAME(pg_conn, click_conn, old_tstamp, new_tstamp):
    read_pg = """SELECT
     report_id, input, s3path, linenum, COALESCE(measurement_uid, '')
    FROM jsonl
    WHERE measurement_uid > %s and measurement_uid < %s
    """
    write_click = """INSERT INTO jsonl (
        report_id, input, s3path, linenum, measurement_uid
    ) VALUES """
    row_count = 0
    with pg_conn.cursor() as pg_cur:
        log.debug(f"Querying PG jsonl {old_tstamp} {new_tstamp}")
        pg_cur.execute(read_pg, [old_tstamp, new_tstamp])
        while True:
            rows = pg_cur.fetchmany(10_000)
            row_count += len(rows)
            if not rows:
                metrics.gauge("sync_clickhouse_jsonl_cnt", row_count)
                return row_count > 0
            click_conn.execute(write_click, rows)
            log.info(f"Inserted {len(rows)} rows into jsonl")
    return row_count > 0