def METHOD_NAME(cursor, table):
    """Returns the date of the oldest closed ARP/CAM record (or from any log table
    using the same start_time/end_time principle as the arp/cam tables
    """
    query = """SELECT start_time::DATE
                FROM
                 (SELECT start_time
                  FROM {table}
                  WHERE end_time < 'infinity'
                  ORDER BY start_time ASC
                  LIMIT 1) AS foo"""
    cursor.execute(query.format(table=table))
    row = cursor.fetchone()
    return row[0] if row else None