Re: proposal \gcsv

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: proposal \gcsv
Дата
Msg-id 8090710a-81cf-4a9e-9067-60ebe917cb8e@manitou-mail.org
обсуждение исходный текст
Ответ на Re: proposal \gcsv  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: proposal \gcsv
Re: proposal \gcsv
Список pgsql-hackers
    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


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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: David Steele
Дата:
Сообщение: Re: BufFileRead() error signalling
Следующее
От: Isaac Morland
Дата:
Сообщение: Re: proposal \gcsv