Re: csv format for psql

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: csv format for psql
Date: 2018-03-10 06:49:45
Message-ID: alpine.DEB.2.20.1803100745440.19949@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


>> recordsep in the unaligned mode doesn't play the role of a line ending
>> because the last line is not finished by recordsep. According to the source
>> code, this is intended, see print_unaligned_text() in print.c:
>
> Something else comes to mind: CSV allows linefeeds inside fields, and
> we don't want to replace these with record separators.

Sure.

> So the notion that recordsep can be used to choose line endings
> is even less okay than if there was just the last line issue.

I'm not following. ISTM that the escaping macanism would work in pretty
all reasonable cases, although it might be possible to shot oneself in the
foot by setting manually strange values for recordsep, eg '"'. I do not
see that as a significant issue. If the user asks for something stupid,
they get something stupid, fine.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2018-03-10 07:40:28 Re: [HACKERS] GSoC 2017: weekly progress reports (week 4) and patch for hash index
Previous Message Fabien COELHO 2018-03-10 06:45:03 Re: csv format for psql