Re: Should CSV parsing be stricter about mid-field quotes?

Поиск
Список
Период
Сортировка
Искать
От
Andrew Dunstan
Тема
Re: Should CSV parsing be stricter about mid-field quotes?
Дата
в 12:24:30
Msg-id
31c81233-d707-0d2a-8111-a915f463459b@dunslane.net
Ответ на
Список
Дерево обсуждения
Should CSV parsing be stricter about mid-field quotes? "Joel Jacobson" <joel@compiler.org>
Re: Should CSV parsing be stricter about mid-field quotes? Pavel Stehule <pavel.stehule@gmail.com>
Re: Should CSV parsing be stricter about mid-field quotes? Greg Stark <stark@mit.edu>
Re: Should CSV parsing be stricter about mid-field quotes? Andrew Dunstan <andrew@dunslane.net>
Re: Should CSV parsing be stricter about mid-field quotes? "Joel Jacobson" <joel@compiler.org>
Re: Should CSV parsing be stricter about mid-field quotes? Andrew Dunstan <andrew@dunslane.net>
Re: Should CSV parsing be stricter about mid-field quotes? Tom Lane <tgl@sss.pgh.pa.us>
Re: Should CSV parsing be stricter about mid-field quotes? Greg Stark <stark@mit.edu>
Re: Should CSV parsing be stricter about mid-field quotes? Andrew Dunstan <andrew@dunslane.net>
Re: Should CSV parsing be stricter about mid-field quotes? "Joel Jacobson" <joel@compiler.org>
Re: Should CSV parsing be stricter about mid-field quotes? "Joel Jacobson" <joel@compiler.org>
Re: Should CSV parsing be stricter about mid-field quotes? Andrew Dunstan <andrew@dunslane.net>
Re: Should CSV parsing be stricter about mid-field quotes? "Joel Jacobson" <joel@compiler.org>
Re: Should CSV parsing be stricter about mid-field quotes? "Daniel Verite" <daniel@manitou-mail.org>
Re: Should CSV parsing be stricter about mid-field quotes? "Joel Jacobson" <joel@compiler.org>
Re: Should CSV parsing be stricter about mid-field quotes? "Daniel Verite" <daniel@manitou-mail.org>
Re: Should CSV parsing be stricter about mid-field quotes? "Joel Jacobson" <joel@compiler.org>
Re: Should CSV parsing be stricter about mid-field quotes? Noah Misch <noah@leadboat.com>
Re: Should CSV parsing be stricter about mid-field quotes? "Joel Jacobson" <joel@compiler.org>
Re: Should CSV parsing be stricter about mid-field quotes? Andrew Dunstan <andrew@dunslane.net>
Re: Should CSV parsing be stricter about mid-field quotes? "Joel Jacobson" <joel@compiler.org>
Re: Should CSV parsing be stricter about mid-field quotes? Andrew Dunstan <andrew@dunslane.net>
Re: Should CSV parsing be stricter about mid-field quotes? Andrew Dunstan <andrew@dunslane.net>
Re: Should CSV parsing be stricter about mid-field quotes? "Joel Jacobson" <joel@compiler.org>
Re: Should CSV parsing be stricter about mid-field quotes? "Daniel Verite" <daniel@manitou-mail.org>
Re: Should CSV parsing be stricter about mid-field quotes? Tom Lane <tgl@sss.pgh.pa.us>
Re: Should CSV parsing be stricter about mid-field quotes? Andrew Dunstan <andrew@dunslane.net>
Re: Should CSV parsing be stricter about mid-field quotes? "Daniel Verite" <daniel@manitou-mail.org>
Re: Should CSV parsing be stricter about mid-field quotes? Kirk Wolak <wolakk@gmail.com>
Re: Should CSV parsing be stricter about mid-field quotes? "Daniel Verite" <daniel@manitou-mail.org>
Re: Should CSV parsing be stricter about mid-field quotes? Kirk Wolak <wolakk@gmail.com>
Re: Should CSV parsing be stricter about mid-field quotes? "Joel Jacobson" <joel@compiler.org>
Re: Should CSV parsing be stricter about mid-field quotes? "Joel Jacobson" <joel@compiler.org>
Re: Should CSV parsing be stricter about mid-field quotes? Andrew Dunstan <andrew@dunslane.net>
Re: Should CSV parsing be stricter about mid-field quotes? Pavel Stehule <pavel.stehule@gmail.com>
Re: Should CSV parsing be stricter about mid-field quotes? "Joel Jacobson" <joel@compiler.org>


On 2023-05-18 Th 02:19, Joel Jacobson wrote:
On Thu, May 18, 2023, at 08:00, Joel Jacobson wrote:
> 1. How about adding a `WITHOUT QUOTE` or `QUOTE NONE` option in conjunction
> with `COPY ... WITH CSV`?

More ideas:
[ QUOTE 'quote_character' | UNQUOTED ]
or
[ QUOTE 'quote_character' | NO_QUOTE ]

Thinking about it, I recall another hack;
specifying a non-existing char as the delimiter to force the entire line into a
single column table. For that use-case, we could also provide an option that
would internally set:

    delimc = '\0';

How about:

[DELIMITER 'delimiter_character' | UNDELIMITED ]
or
[DELIMITER 'delimiter_character' | NO_DELIMITER ]
or it should be more use-case-based and intuitive:
[DELIMITER 'delimiter_character' | WHOLE_LINE_AS_RECORD ]



QUOTE NONE and DELIMITER NONE should work fine. NONE is already a keyword, so the disturbance should be minimal.


cheers


andrew


--
Andrew Dunstan
EDB: https://www.enterprisedb.com
В списке pgsql-hackers по дате отправления
От: Andrew Dunstan
Дата:
От: Aleksander Alekseev
Дата:
FAQ