Re: proposal: multiple psql option -c

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: proposal: multiple psql option -c
Дата
Msg-id CAFj8pRCYzc+DoOsnS+GtZ0rstpgMxKdu4b_rqEUNshme6t0pZg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: proposal: multiple psql option -c  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Ответы Re: proposal: multiple psql option -c  (Rosser Schwarz <rosser.schwarz@gmail.com>)
Список pgsql-hackers


2015-07-16 22:07 GMT+02:00 Fabrízio de Royes Mello <fabriziomello@gmail.com>:

On Thu, Jul 16, 2015 at 4:42 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
>
> Hi
>
> can we support multiple "-c" option?
>
> Why? Because some statements like VACUUM cannot be used together with any other statements with single -c option. The current solution is using echo and pipe op, but it is a complication in some complex scripts - higher complication when you run psql via multiple sudo statement.
>
> Example:
>
> psql -c "select pg_stat_reset()" -c "vacuum full analyze" dbname
>
> or on all db
>
> psql -At -c "select datname from pg_databases" postgres | \
> xargs -n 1 -P 3 psql -c "..." -c "..."
>
> Ideas, notes, comments?
>

Why you want it if we already have the -f option that cover this use case?


It doesn't help me - we would to run script or remote script (via ssh) without necessity to create (and later drop) files on production servers.

remote execution of scripts is much more simple if you don't need to create any script files.

Regards

Pavel
 
Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog: http://fabriziomello.github.io
>> Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello
>> Github: http://github.com/fabriziomello

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

Предыдущее
От: Fabrízio de Royes Mello
Дата:
Сообщение: Re: proposal: multiple psql option -c
Следующее
От: Rosser Schwarz
Дата:
Сообщение: Re: proposal: multiple psql option -c