Re: proposal: multiple psql option -c
От | Marc Mamin |
---|---|
Тема | Re: proposal: multiple psql option -c |
Дата | |
Msg-id | B6F6FD62F2624C4C9916AC0175D56D8828C18B8B@jenmbs01.ad.intershop.net обсуждение исходный текст |
Ответ на | Re: proposal: multiple psql option -c (Pavel Stehule <pavel.stehule@gmail.com>) |
Список | pgsql-hackers |
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;"><br /> ><br /> ><br /> >2015-07-2810:43 GMT+02:00 Marc Mamin <M.Mamin@intershop.de>:<br /> ><br /> ><br /> > ><br /> > ><br /> > >2015-07-28 5:24 GMT+02:00 Pavel Stehule <pavel.stehule@gmail.com>:<br /> > ><br/> > > 2015-07-27 21:57 GMT+02:00 Andrew Dunstan <andrew@dunslane.net>:<br /> > ><br />> > On 07/27/2015 02:53 PM, Pavel Stehule wrote:<br /> > ><br /> > > I amtrying to run parallel execution<br /> > ><br /> > > psql -At -c "select datname from pg_database"postgres | xargs -n 1 -P 3 psql -c "select current_database()"<br /> > ><br /> > ><br /> > ><br /> > > I don't think it's going to be a hugely important feature, but I don't see a problemwith creating a new option (-C seems fine) which would have the same effect as if the arguments were contatenatedinto a file which is then used with -f. IIRC -c has some special characteristics which means it's probably bestnot to try to extend it for this feature.<br /> > ><br /> > ><br /> > > ok, I'll try towrite patch.<br /> > ><br /> > ><br /> > >I have a question. Can be -C option multiple?<br />><br /> ><br /> > hello,<br /> > Have you thought of how to support -1 along with -C ?<br /> ><br/> > > handle the input as with -f<br /> > that is, -1 -C would be equivalent to -c<br /> ><br/> > and<br /> > psql -1 -C "sql_1; sql_2;" -C "sql_3; sql_4;"<br /> ><br /> > => ?<br />><br /> > BEGIN; <br /> > sql_1; <br /> > sql_2; <br /> > END; <br /> ><br /> > BEGIN;<br /> > sql_3;<br /> > sql_4;<br /> > END;<br /> ><br />> thoughts ?<br /> ><br /> ><br /> >"-1" option is global -, I expected so following steps are more natural<br/> ><br /> >BEGIN<br /> > sql_1;<br /> > sql_2;<br /> > sql_3;<br /> > sql_4;<br /> >END;<br/><br /> This is then exactly the same as -c. <br /> If introducing multiple -C to better manage transaction handling,<br /> why not enrich this new feature with the abilities to define batches of transactions ?<br /><br /> Marc</div>
В списке pgsql-hackers по дате отправления: