Re: csv format for psql
От | Fabien COELHO |
---|---|
Тема | Re: csv format for psql |
Дата | |
Msg-id | alpine.DEB.2.21.1808281954040.21980@lancre обсуждение исходный текст |
Ответ на | Re: csv format for psql ("Daniel Verite" <daniel@manitou-mail.org>) |
Ответы |
Re: csv format for psql
|
Список | pgsql-hackers |
Bonjour Daniel, > Currently popt->topt.fieldSepCsv can't be NULL so I've simplified this > to just return pset_quoted_string(popt->topt.fieldSepCsv). Ok. >> While testing I found a small issue if "fieldsep_csv" is set to a strange >> value: >> >> \pset format_csv ',,' > > You meant \pset fieldsep_csv ',,' Indeed. > If you do that even SELECT 'foo', 'bar' comes out wrong because it looks > like a 3-field row: foo,,bar Yes and no. I asked for ",," as a separator, so probably I really want that and I'd be okay with the result. > If we want to prevent people to shoot themselves in the foot with that > sort of thing, I've added a couple tests: No double quote, no LF or > CR, single character (but multibyte allowed) for the separator. Ok, why not. Patch applies cleanly, compiles, "make check" ok. I tried "\pset fieldsep_csv '\0'" which could be seen as one character, but it does not want it. I'm okay with this behavior. I'd suggest to add a test about rejected fieldsep_csv values, which raises both errors. -- Fabien.
В списке pgsql-hackers по дате отправления: