Re: csv format for psql

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: David Fetter <david(at)fetter(dot)org>, Daniel Verite <daniel(at)manitou-mail(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: csv format for psql
Date: 2018-03-08 08:40:59
Message-ID: CAFj8pRCCAFMMY-2z-YfjtrC6yeNdm=rHnFVrK2KnvO1iRPDJ2g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2018-03-08 9:29 GMT+01:00 Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>:

>
> I.e. really generate some csv from the data in just one option, not many.
>>>
>>> But this is obviously debatable.
>>>
>>
>> I suspect we'll get requests for an all-JSON option, HTML tables,
>> etc., assuming we don't have them already.
>>
>
> I would definitely be fine with --html (which indeed already exists) &
> --json (which does not, but could some day) as long options.
>
> I'm hoping we can have that all in one framework.
>>
>
> ISTM that it is more or less the case if an option simply presets a bunch
> of existing table output options which is an existing framework.
>
> I get that setting each of tuples_only, fieldsep, recordsep, etc. might be
>> a bit of a lift for some users, but it's not clear how we'd make a sane
>> default that made choices among those correct for enough users. For
>> example, do we know that we want tuples_only behavior by default? A lot of
>> people's CSV tools assume a header row.
>>
>
> If there is a possible disagreement on one option, then let it out and use
> the corresponding short option if needed?
>
> Tuple only:
>
> psql --csv -t -c 'TABLE foo' -o foo.csv
>
> With title headers:
>
> psql --csv -c 'TABLE foo' -o foo.csv
>
> Would be okay.
>

+1

Pavel

>
> --
> Fabien.
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ildar Musin 2018-03-08 09:07:50 Re: Failed to request an autovacuum work-item in silence
Previous Message Fabien COELHO 2018-03-08 08:29:06 Re: csv format for psql