Re: proposal: multiple psql option -c

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: proposal: multiple psql option -c
Дата
Msg-id CAFj8pRDSu1nQOME92GvQFzkhrt_gbiLsY8grg+pSjXQzOXAyvg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: proposal: multiple psql option -c  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: proposal: multiple psql option -c  (Marc Mamin <M.Mamin@intershop.de>)
Re: proposal: multiple psql option -c  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers


2015-07-28 5:24 GMT+02:00 Pavel Stehule <pavel.stehule@gmail.com>:


2015-07-27 21:57 GMT+02:00 Andrew Dunstan <andrew@dunslane.net>:

On 07/27/2015 02:53 PM, Pavel Stehule wrote:




I am trying to run parallel execution

psql -At -c "select datname from pg_database" postgres | xargs -n 1 -P 3 psql -c "select current_database()"




I don't think it's going to be a hugely important feature, but I don't see a problem with creating a new option (-C seems fine) which would have the same effect as if the arguments were contatenated into a file which is then used with -f. IIRC -c has some special characteristics which means it's probably best not to try to extend it for this feature.

ok, I'll try to write patch.

I have a question. Can be -C option multiple?

The SQL is without problem, but what about \x command?

postgres=# \dt \dn select 10;
No relations found.
List of schemas
┌──────┬───────┐
│ Name │ Owner │
╞══════╪═══════╡
└──────┴───────┘
(0 rows)

\dn: extra argument "10;" ignored


some like

psql -C "\dt \dn" -C "select 10"

It is looking better than psql -c "\dt \dn \n select 10"

Regards

Pavel

 

Pavel
 

cheers

andrew


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

Предыдущее
От: David Belle
Дата:
Сообщение: Feature - Index support on an lquery field (from the ltree module)
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: [DESIGN] ParallelAppend