Skip to main content

Description

Comma Separated Values format (RFC). When formatting, rows are enclosed in double quotes. A double quote inside a string is output as two double quotes in a row. There are no other rules for escaping characters.
  • Date and date-time are enclosed in double quotes.
  • Numbers are output without quotes.
  • Values are separated by a delimiter character, which is , by default. The delimiter character is defined in the setting format_csv_delimiter.
  • Rows are separated using the Unix line feed (LF).
  • Arrays are serialized in CSV as follows:
    • first, the array is serialized to a string as in TabSeparated format
    • The resulting string is output to CSV in double quotes.
  • Tuples in CSV format are serialized as separate columns (that is, their nesting in the tuple is lost).
By default, the delimiter is , See the format_csv_delimiter setting for more information.
When parsing, all values can be parsed either with or without quotes. Both double and single quotes are supported. Rows can also be arranged without quotes. In this case, they are parsed up to the delimiter character or line feed (CR or LF). However, in violation of the RFC, when parsing rows without quotes, the leading and trailing spaces and tabs are ignored. The line feed supports: Unix (LF), Windows (CR LF) and Mac OS Classic (CR LF) types. NULL is formatted according to setting format_csv_null_representation (the default value is \N). In the input data, ENUM values can be represented as names or as ids. First, we try to match the input value to the ENUM name. If we fail and the input value is a number, we try to match this number to the ENUM id. If input data contains only ENUM ids, it’s recommended to enable the setting input_format_csv_enum_as_number to optimize ENUM parsing.

Example usage

Format settings

Last modified on July 25, 2026