Re: csv format for psql

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: csv format for psql
Date: 2018-11-09 12:11:10
Message-ID: 20181109121110.GB22720@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 09, 2018 at 11:40:44AM +0100, Daniel Verite wrote:
> The above is meant to accept a multibyte character as the separator,
> in which case strlen(value) would be greater than 1.

Still what's the point except complicating the code? We don't care
about anything fancy in the backend-side ProcessCopyOptions() when
checking cstate->delim, and having some consistency looks like a good
thing to me.

I am also questioning a couple of things: it is possible to choose
freely how to represent a null value thanks to "\pset null", which gives
an equivalent to the COPY option. Choosing if a header is present or
not can be done with tuples_only. However there is no option to specify
an escape character, no option to specify a quote character, and it is
not possible to force quotes for all values. Those are huge advantages
as any output can be made compatible with other CSV variants. Isn't
what is presented too limited? \copy has at least the advantage to push
down those responsibilities to the backend..
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Evgeniy Efimkin 2018-11-09 12:24:17 Re: Special role for subscriptions
Previous Message Laurenz Albe 2018-11-09 11:53:01 Re: Libpq support to connect to standby server as priority