Re: proposal \gcsv

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Vik Fearing <vik(at)postgresfriends(dot)org>, Erik Rijkers <er(at)xs4all(dot)nl>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal \gcsv
Date: 2020-04-01 16:03:20
Message-ID: CAFj8pRAWeUcwu+HDVR+7mhRXZP8kSMVq46xDORi7BJRLJ_CcHg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

st 1. 4. 2020 v 17:52 odesílatel Daniel Verite <daniel(at)manitou-mail(dot)org>
napsal:

> Tom Lane wrote:
>
> > I could see having a command to copy the current primary formatting
> > parameters to the alternate area, too.
>
> We could have a stack to store parameters before temporary
> changes, for instance if you want to do one csv export and
> come back to normal without assuming what "normal"
> values were.
>
> \pset push format csv_fieldsep
> \pset format csv
> \pset csv_fielsep '\t'
> some command \g somefile
> \pset pop
>
> So \pset pop would reset the pushed parameters
> to their values when pushed, which also could be all
> parameters:
>
> \pset push all
> \pset param1 something
> \pset param2 something-else
> ...other commands...
> \pset pop
>
> or
>
> \pset push all
> \i somescript.sql
> \pset pop
>
>
It can work, but it is not user friendly - my proposal was motivated by
using some quick csv exports to gplot's pipe.

Regards

Pavel

>
> Best regards,
> --
> Daniel Vérité
> PostgreSQL-powered mailer: http://www.manitou-mail.org
> Twitter: @DanielVerite
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2020-04-01 16:03:35 Re: pgbench - add pseudo-random permutation function
Previous Message Robert Haas 2020-04-01 16:02:18 Re: snapshot too old issues, first around wraparound and then more.