st 23. 12. 2020 v 16:54 odesílatel Bruce Momjian <bruce@momjian.us> napsal:
On Wed, Dec 23, 2020 at 04:39:48PM +0100, Pavel Stehule wrote: > > > st 23. 12. 2020 v 16:24 odesílatel Tom Lane <tgl@sss.pgh.pa.us> napsal: > > Bruce Momjian <bruce@momjian.us> writes: > > On Wed, Dec 23, 2020 at 07:18:24AM +0100, Pavel Stehule wrote: > >> Implementation of tsv format should not be hard. > >> What do you think about this? > > > How would you handle tabs in the data? > > The main problem with csv is the severe lack of standardization > around what to do with corner cases (delimiters in data, empty > fields, etc). Seems like "tsv" would be even worse. Is there > an actual standard anywhere? > > > Probably not - there are just common conventions. > > standard disallows tab chars inside > > https://www.iana.org/assignments/media-types/text/tab-separated-values
Is it too awkward to throw an error if there is a tab?
This is a question. Maybe more practical can be some form of escaping (in conformance with COPY tsv format) or using CSV rules for special chars (it does LO). But raising an error can be correct too. It is true, so typical data should not contain tabs. For example LO Calc can hold tabs in cell, can export data in cell, but the tabs in cells are not visible, and import data with tabs are broken (and then probably, the data with tabs are not common).