def row_to_string(row, is_header=False):
    """Convert a row to a string, mangling times to be more compact

    Args:
        row (tuple): Row of values from a psycopg2 query

    Yields:
        string: Stringified version of the row
    """
    row = list(row)
    for i, val in enumerate(row):
        if not is_header:
            # Quote things that are natively strings
            if isinstance(val, str):
                row[i] = "'{}'".format(val)
        else:
            try:
                row[i] = "<{}>({})".format(
                    type(val).__name__,
                    val.isoformat()
                )
            except AttributeError:
                pass

    joined = "|".join([str(val) for val in row])
    return joined.replace('\n', r'\n')