Re: [HACKERS] proposal: multiple psql option -c

2016-02-09 Thread Robert Haas
On Thu, Feb 4, 2016 at 8:35 PM, Peter Eisentraut wrote: > I generally use the master branch psql for normal work, and this change > has caused massive breakage for me. It's straightforward to fix, but in > some cases the breakage is silent, for example if you do > something=$(psql -c ...) and the

Re: [HACKERS] proposal: multiple psql option -c

2016-02-07 Thread Pavel Stehule
2016-02-05 2:35 GMT+01:00 Peter Eisentraut : > On 12/29/15 10:38 AM, Bruce Momjian wrote: > > On Thu, Dec 10, 2015 at 11:10:55AM -0500, Robert Haas wrote: > >> On Wed, Dec 9, 2015 at 12:15 AM, Pavel Stehule > wrote: > On Wed, Dec 9, 2015 at 2:07 PM, Pavel Stehule < > pavel.steh...@gmail.com>

Re: [HACKERS] proposal: multiple psql option -c

2016-02-04 Thread Peter Eisentraut
On 12/29/15 10:38 AM, Bruce Momjian wrote: > On Thu, Dec 10, 2015 at 11:10:55AM -0500, Robert Haas wrote: >> On Wed, Dec 9, 2015 at 12:15 AM, Pavel Stehule >> wrote: On Wed, Dec 9, 2015 at 2:07 PM, Pavel Stehule wrote: > should be noted, recorded somewhere so this introduce possibl

Re: [HACKERS] proposal: multiple psql option -c

2015-12-29 Thread Bruce Momjian
On Thu, Dec 10, 2015 at 11:10:55AM -0500, Robert Haas wrote: > On Wed, Dec 9, 2015 at 12:15 AM, Pavel Stehule > wrote: > >> On Wed, Dec 9, 2015 at 2:07 PM, Pavel Stehule > >> wrote: > >> > should be noted, recorded somewhere so this introduce possible > >> > compatibility > >> > issue - due defa

Re: [HACKERS] proposal: multiple psql option -c

2015-12-10 Thread Robert Haas
On Wed, Dec 9, 2015 at 12:15 AM, Pavel Stehule wrote: >> On Wed, Dec 9, 2015 at 2:07 PM, Pavel Stehule >> wrote: >> > should be noted, recorded somewhere so this introduce possible >> > compatibility >> > issue - due default processing .psqlrc. >> >> That's written in the commit log, so I guess t

Re: [HACKERS] proposal: multiple psql option -c

2015-12-08 Thread Pavel Stehule
2015-12-09 6:10 GMT+01:00 Michael Paquier : > On Wed, Dec 9, 2015 at 2:07 PM, Pavel Stehule > wrote: > > should be noted, recorded somewhere so this introduce possible > compatibility > > issue - due default processing .psqlrc. > > That's written in the commit log, so I guess that's fine. > ook

Re: [HACKERS] proposal: multiple psql option -c

2015-12-08 Thread Michael Paquier
On Wed, Dec 9, 2015 at 2:07 PM, Pavel Stehule wrote: > should be noted, recorded somewhere so this introduce possible compatibility > issue - due default processing .psqlrc. That's written in the commit log, so I guess that's fine. -- Michael -- Sent via pgsql-hackers mailing list (pgsql-hack

Re: [HACKERS] proposal: multiple psql option -c

2015-12-08 Thread Pavel Stehule
2015-12-09 1:27 GMT+01:00 Michael Paquier : > On Wed, Dec 9, 2015 at 5:08 AM, Pavel Stehule > wrote: > > 2015-12-08 20:09 GMT+01:00 Robert Haas : > >> On Sun, Dec 6, 2015 at 9:27 AM, Michael Paquier > >> wrote: > >> > On Sun, Dec 6, 2015 at 10:56 PM, Michael Paquier > >> > wrote: > >> >> Thanks

Re: [HACKERS] proposal: multiple psql option -c

2015-12-08 Thread Michael Paquier
On Wed, Dec 9, 2015 at 5:08 AM, Pavel Stehule wrote: > 2015-12-08 20:09 GMT+01:00 Robert Haas : >> On Sun, Dec 6, 2015 at 9:27 AM, Michael Paquier >> wrote: >> > On Sun, Dec 6, 2015 at 10:56 PM, Michael Paquier >> > wrote: >> >> Thanks, I looked at that again and problem is fixed as attached. >>

Re: [HACKERS] proposal: multiple psql option -c

2015-12-08 Thread Pavel Stehule
2015-12-08 20:09 GMT+01:00 Robert Haas : > On Sun, Dec 6, 2015 at 9:27 AM, Michael Paquier > wrote: > > On Sun, Dec 6, 2015 at 10:56 PM, Michael Paquier > > wrote: > >> Thanks, I looked at that again and problem is fixed as attached. > > > > Er, not exactly... poll_query_until in PostgresNode.pm

Re: [HACKERS] proposal: multiple psql option -c

2015-12-08 Thread David Fetter
On Tue, Dec 08, 2015 at 01:51:57PM -0500, Robert Haas wrote: > On Fri, Dec 4, 2015 at 11:08 AM, Catalin Iacob wrote: > > On Fri, Dec 4, 2015 at 3:47 PM, Robert Haas wrote: > >> For the most part, the cleanups in this version are just cosmetic: I > >> fixed some whitespace damage, and reverted som

Re: [HACKERS] proposal: multiple psql option -c

2015-12-08 Thread Robert Haas
On Sun, Dec 6, 2015 at 9:27 AM, Michael Paquier wrote: > On Sun, Dec 6, 2015 at 10:56 PM, Michael Paquier > wrote: >> Thanks, I looked at that again and problem is fixed as attached. > > Er, not exactly... poll_query_until in PostgresNode.pm is using psql > -c without the --no-psqlrc switch so th

Re: [HACKERS] proposal: multiple psql option -c

2015-12-08 Thread Robert Haas
On Fri, Dec 4, 2015 at 11:08 AM, Catalin Iacob wrote: > On Fri, Dec 4, 2015 at 3:47 PM, Robert Haas wrote: >> For the most part, the cleanups in this version are just cosmetic: I >> fixed some whitespace damage, and reverted some needless changes to >> the psql references page that were whitespac

Re: [HACKERS] proposal: multiple psql option -c

2015-12-06 Thread Michael Paquier
On Sun, Dec 6, 2015 at 10:56 PM, Michael Paquier wrote: > Thanks, I looked at that again and problem is fixed as attached. Er, not exactly... poll_query_until in PostgresNode.pm is using psql -c without the --no-psqlrc switch so this patch causes the regression tests of pg_rewind to fail. Fixed a

Re: [HACKERS] proposal: multiple psql option -c

2015-12-06 Thread Michael Paquier
On Fri, Dec 4, 2015 at 11:47 PM, Robert Haas wrote: > On Wed, Dec 2, 2015 at 12:33 AM, Pavel Stehule > wrote: >>> Yeah, I don't think that's a big issue either to be honest. The code >>> is kept consistent a maximum with what is there previously. >>> >>> Patch is switched to ready for committer.

Re: [HACKERS] proposal: multiple psql option -c

2015-12-04 Thread Catalin Iacob
On Fri, Dec 4, 2015 at 3:47 PM, Robert Haas wrote: > For the most part, the cleanups in this version are just cosmetic: I > fixed some whitespace damage, and reverted some needless changes to > the psql references page that were whitespace-only adjustments. In a > few places, I tweaked documentat

Re: [HACKERS] proposal: multiple psql option -c

2015-12-04 Thread Robert Haas
On Wed, Dec 2, 2015 at 12:33 AM, Pavel Stehule wrote: >> Yeah, I don't think that's a big issue either to be honest. The code >> is kept consistent a maximum with what is there previously. >> >> Patch is switched to ready for committer. > > perfect > > Thank you very much to all I did some edits

Re: [HACKERS] proposal: multiple psql option -c

2015-12-01 Thread Pavel Stehule
Hi > Yeah, I don't think that's a big issue either to be honest. The code > is kept consistent a maximum with what is there previously. > > Patch is switched to ready for committer. > perfect Thank you very much to all Regards Pavel > -- > Michael >

Re: [HACKERS] proposal: multiple psql option -c

2015-12-01 Thread Michael Paquier
On Wed, Dec 2, 2015 at 2:56 AM, Pavel Stehule wrote: > 2015-12-01 17:52 GMT+01:00 Catalin Iacob : >> One maybe slightly surprising behaviour is that -f - can be specified >> multiple times and only the first one has an effect since the others >> act on an exhausted stdin. But I don't think forbidd

Re: [HACKERS] proposal: multiple psql option -c

2015-12-01 Thread Pavel Stehule
2015-12-01 17:52 GMT+01:00 Catalin Iacob : > On Tue, Dec 1, 2015 at 1:53 PM, Michael Paquier > wrote: > > Attached is a patch implementing those suggestions. This simplifies > > the code without changing its usefulness. If you are fine with those > > changes I will switch this patch as ready for

Re: [HACKERS] proposal: multiple psql option -c

2015-12-01 Thread Pavel Stehule
2015-12-01 13:53 GMT+01:00 Michael Paquier : > On Tue, Dec 1, 2015 at 11:46 AM, Pavel Stehule > wrote: > > 2015-11-30 15:17 GMT+01:00 Michael Paquier : > >> Removing some items from the list of potential actions and creating a > >> new sublist listing action types is a bit weird. Why not grouping

Re: [HACKERS] proposal: multiple psql option -c

2015-12-01 Thread Catalin Iacob
On Tue, Dec 1, 2015 at 1:53 PM, Michael Paquier wrote: > Attached is a patch implementing those suggestions. This simplifies > the code without changing its usefulness. If you are fine with those > changes I will switch this patch as ready for committer. I tested the v07 patch (so not Michael's v

Re: [HACKERS] proposal: multiple psql option -c

2015-12-01 Thread Michael Paquier
On Tue, Dec 1, 2015 at 11:46 AM, Pavel Stehule wrote: > 2015-11-30 15:17 GMT+01:00 Michael Paquier : >> Removing some items from the list of potential actions and creating a >> new sublist listing action types is a bit weird. Why not grouping them >> together and allow for example -l as well in th

Re: [HACKERS] proposal: multiple psql option -c

2015-11-30 Thread Pavel Stehule
2015-11-30 15:17 GMT+01:00 Michael Paquier : > On Thu, Nov 26, 2015 at 4:21 AM, Pavel Stehule wrote: > > Attached patch per Tom Lane proposal. > > > > * multiple -c -f options are supported, the order of options is respected > > * the statements for one -c options are executed in transactions > >

Re: [HACKERS] proposal: multiple psql option -c

2015-11-30 Thread Michael Paquier
On Thu, Nov 26, 2015 at 4:21 AM, Pavel Stehule wrote: > Attached patch per Tom Lane proposal. > > * multiple -c -f options are supported, the order of options is respected > * the statements for one -c options are executed in transactions > * Iacob's doc patch merged enum _actions { ACT_

Re: [HACKERS] proposal: multiple psql option -c

2015-11-25 Thread Pavel Stehule
Hi 2015-11-25 17:13 GMT+01:00 Catalin Iacob : > On Wed, Nov 18, 2015 at 5:49 PM, Catalin Iacob > wrote: > > On Tue, Nov 17, 2015 at 10:13 PM, Tom Lane wrote: > >> 1. -c no longer implies --no-psqlrc. That's a backwards > incompatibility, > >> but very easy to explain and very easy to work arou

Re: [HACKERS] proposal: multiple psql option -c

2015-11-25 Thread Catalin Iacob
On Wed, Nov 18, 2015 at 5:49 PM, Catalin Iacob wrote: > On Tue, Nov 17, 2015 at 10:13 PM, Tom Lane wrote: >> 1. -c no longer implies --no-psqlrc. That's a backwards incompatibility, >> but very easy to explain and very easy to work around. >> >> 2. You can have multiple -c and/or -f. Each -c is

Re: [HACKERS] proposal: multiple psql option -c

2015-11-18 Thread Pavel Stehule
2015-11-18 21:17 GMT+01:00 Tom Lane : > Pavel Stehule writes: > >> 1. -c no longer implies --no-psqlrc. That's a backwards > incompatibility, > >> but very easy to explain and very easy to work around. > > > This can be very surprising change. Can we disable it temporary by some > > environment

Re: [HACKERS] proposal: multiple psql option -c

2015-11-18 Thread Robert Haas
On Wed, Nov 18, 2015 at 3:17 PM, Tom Lane wrote: > Pavel Stehule writes: >>> 1. -c no longer implies --no-psqlrc. That's a backwards incompatibility, >>> but very easy to explain and very easy to work around. > >> This can be very surprising change. Can we disable it temporary by some >> environ

Re: [HACKERS] proposal: multiple psql option -c

2015-11-18 Thread Tom Lane
Pavel Stehule writes: >> 1. -c no longer implies --no-psqlrc. That's a backwards incompatibility, >> but very easy to explain and very easy to work around. > This can be very surprising change. Can we disable it temporary by some > environment variable? like NOPSQLRC ? Why would that be better

Re: [HACKERS] proposal: multiple psql option -c

2015-11-18 Thread Pavel Stehule
> 1. -c no longer implies --no-psqlrc. That's a backwards incompatibility, > but very easy to explain and very easy to work around. > > This can be very surprising change. Can we disable it temporary by some environment variable? like NOPSQLRC ? > 2. You can have multiple -c and/or -f. Each -c

Re: [HACKERS] proposal: multiple psql option -c

2015-11-18 Thread Catalin Iacob
On Tue, Nov 17, 2015 at 10:13 PM, Tom Lane wrote: > 1. -c no longer implies --no-psqlrc. That's a backwards incompatibility, > but very easy to explain and very easy to work around. > > 2. You can have multiple -c and/or -f. Each -c is processed in > the traditional way, ie, either it's a single

Re: [HACKERS] proposal: multiple psql option -c

2015-11-17 Thread Andrew Dunstan
On 11/17/2015 04:13 PM, Tom Lane wrote: Robert Haas writes: A few years ago there was a proposal to not only allow multiple -c options, but to allow -c and -f to be intermingled. This seems really rather useful; I'd like to be able to type psql -c do_this_first -f script.sql and have that wo

Re: [HACKERS] proposal: multiple psql option -c

2015-11-17 Thread Tom Lane
Robert Haas writes: > A few years ago there was a proposal to not only allow multiple -c > options, but to allow -c and -f to be intermingled. This seems really > rather useful; I'd like to be able to type psql -c do_this_first -f > script.sql and have that work. But of course it's kind of hard

Re: [HACKERS] proposal: multiple psql option -c

2015-11-17 Thread Pavel Stehule
2015-11-17 21:00 GMT+01:00 Robert Haas : > On Tue, Nov 17, 2015 at 2:25 PM, Tom Lane wrote: > > Robert Haas writes: > >> On Mon, Nov 16, 2015 at 6:05 PM, Andrew Dunstan > wrote: > >>> I honestly don't see what's so confusing about it, and if there is any > >>> confusion then surely we could mak

Re: [HACKERS] proposal: multiple psql option -c

2015-11-17 Thread Robert Haas
On Tue, Nov 17, 2015 at 2:25 PM, Tom Lane wrote: > Robert Haas writes: >> On Mon, Nov 16, 2015 at 6:05 PM, Andrew Dunstan wrote: >>> I honestly don't see what's so confusing about it, and if there is any >>> confusion then surely we could make sure what's happening is well >>> documented. > >> +

Re: [HACKERS] proposal: multiple psql option -c

2015-11-17 Thread Pavel Stehule
> Well, it's not *entirely* true that it has only backwards compatibility > to recommend it: without -c in its current form, there would be no way > to test multiple-commands-in-one-PQexec cases without hacking up some > custom test infrastructure. That's not a very strong reason maybe, but > it's

Re: [HACKERS] proposal: multiple psql option -c

2015-11-17 Thread Tom Lane
Robert Haas writes: > On Mon, Nov 16, 2015 at 6:05 PM, Andrew Dunstan wrote: >> I honestly don't see what's so confusing about it, and if there is any >> confusion then surely we could make sure what's happening is well >> documented. > +1. I'm actually kind of wondering if we should just back

Re: [HACKERS] proposal: multiple psql option -c

2015-11-17 Thread Robert Haas
On Mon, Nov 16, 2015 at 6:05 PM, Andrew Dunstan wrote: > I honestly don't see what's so confusing about it, and if there is any > confusion then surely we could make sure what's happening is well > documented. +1. I'm actually kind of wondering if we should just back up and change the way -c wor

Re: [HACKERS] proposal: multiple psql option -c

2015-11-16 Thread Andrew Dunstan
On 11/16/2015 11:16 AM, Catalin Iacob wrote: On Sun, Nov 15, 2015 at 3:53 PM, Andrew Dunstan wrote: I suggest you review the original thread on this subject before a line was ever written. "multiple" (see subject line on this whole thread) is clearly what is being asked for. Making people tur

Re: [HACKERS] proposal: multiple psql option -c

2015-11-16 Thread Pavel Stehule
Hi 2015-11-16 17:16 GMT+01:00 Catalin Iacob : > On Sun, Nov 15, 2015 at 3:53 PM, Andrew Dunstan > wrote: > > I suggest you review the original thread on this subject before a line > was > > ever written. "multiple" (see subject line on this whole thread) is > clearly > > what is being asked for.

Re: [HACKERS] proposal: multiple psql option -c

2015-11-16 Thread Catalin Iacob
On Sun, Nov 15, 2015 at 3:53 PM, Andrew Dunstan wrote: > I suggest you review the original thread on this subject before a line was > ever written. "multiple" (see subject line on this whole thread) is clearly > what is being asked for. Making people turn that into a single argument is > not what

Re: [HACKERS] proposal: multiple psql option -c

2015-11-16 Thread Andrew Dunstan
On 11/15/2015 08:24 PM, Peter Eisentraut wrote: On 11/15/15 9:53 AM, Andrew Dunstan wrote: I suggest you review the original thread on this subject before a line was ever written. "multiple" (see subject line on this whole thread) is clearly what is being asked for. Making people turn that int

Re: [HACKERS] proposal: multiple psql option -c

2015-11-15 Thread Peter Eisentraut
On 11/15/15 9:53 AM, Andrew Dunstan wrote: > I suggest you review the original thread on this subject before a line > was ever written. "multiple" (see subject line on this whole thread) is > clearly what is being asked for. Making people turn that into a single > argument is not what was envisaged

Re: [HACKERS] proposal: multiple psql option -c

2015-11-15 Thread Andrew Dunstan
On 11/15/2015 08:50 AM, Catalin Iacob wrote: On Sun, Nov 15, 2015 at 1:27 AM, Andrew Dunstan wrote: That seems to me to get rid of the main motivation for this change, which is to allow multiple such arguments, which together would as as if they were all written to a file which was then invok

Re: [HACKERS] proposal: multiple psql option -c

2015-11-15 Thread Catalin Iacob
On Sun, Nov 15, 2015 at 1:27 AM, Andrew Dunstan wrote: > That seems to me to get rid of the main motivation for this change, which is > to allow multiple such arguments, which together would as as if they were > all written to a file which was then invoked like -f file. It seems to me the motivat

Re: [HACKERS] proposal: multiple psql option -c

2015-11-14 Thread Andrew Dunstan
On 11/13/2015 03:54 PM, Catalin Iacob wrote: So my proposal is: allow a *single* argument for -C and treat its content *exactly* like the input from stdin or from a file. That seems to me to get rid of the main motivation for this change, which is to allow multiple such arguments, which to

Re: [HACKERS] proposal: multiple psql option -c

2015-11-13 Thread David G. Johnston
On Fri, Nov 13, 2015 at 1:54 PM, Catalin Iacob wrote: > So I promised I'd try to document this. I had a look at the proposed > semantics of -C and I think in the patch they're too complicated which > makes explaining them hard. > > My assumptions about behaviour without this patch, from reading t

Re: [HACKERS] proposal: multiple psql option -c

2015-11-13 Thread Catalin Iacob
So I promised I'd try to document this. I had a look at the proposed semantics of -C and I think in the patch they're too complicated which makes explaining them hard. My assumptions about behaviour without this patch, from reading the docs and some experimenting, correct me if I'm wrong: 1. psql

Re: [HACKERS] proposal: multiple psql option -c

2015-11-11 Thread Pavel Stehule
2015-11-12 1:35 GMT+01:00 David G. Johnston : > On Wed, Nov 11, 2015 at 7:01 AM, Michael Paquier < > michael.paqu...@gmail.com> wrote: > >> It seems to me that the documentation should specify that when -C is >> used with -1 each individual series of commands is executed within a >> transaction bl

Re: [HACKERS] proposal: multiple psql option -c

2015-11-11 Thread Michael Paquier
On Thu, Nov 12, 2015 at 9:35 AM, David G. Johnston wrote: > On Wed, Nov 11, 2015 at 7:01 AM, Michael Paquier > wrote: >> >> It seems to me that the documentation should specify that when -C is >> used with -1 each individual series of commands is executed within a >> transaction block. > > In sum

Re: [HACKERS] proposal: multiple psql option -c

2015-11-11 Thread David G. Johnston
On Wed, Nov 11, 2015 at 7:01 AM, Michael Paquier wrote: > It seems to me that the documentation should specify that when -C is > used with -1 each individual series of commands is executed within a > transaction block. ​In summary: Default (Not Single + Auto-Commit): One Transactions per parse

Re: [HACKERS] proposal: multiple psql option -c

2015-11-11 Thread Michael Paquier
On Tue, Nov 10, 2015 at 2:18 AM, Pavel Stehule wrote: > Hi > > 2015-11-05 22:23 GMT+01:00 Robert Haas : >> >> On Thu, Nov 5, 2015 at 3:53 PM, Catalin Iacob >> wrote: >> > On Thu, Nov 5, 2015 at 5:27 PM, Robert Haas >> > wrote: >> >>> I wrote some text. But needs some work of native speaker. >> >

Re: [HACKERS] proposal: multiple psql option -c

2015-11-09 Thread Pavel Stehule
Hi 2015-11-05 22:23 GMT+01:00 Robert Haas : > On Thu, Nov 5, 2015 at 3:53 PM, Catalin Iacob > wrote: > > On Thu, Nov 5, 2015 at 5:27 PM, Robert Haas > wrote: > >>> I wrote some text. But needs some work of native speaker. > >> > >> It does. It would be nice if some kind reviewer could help vol

Re: [HACKERS] proposal: multiple psql option -c

2015-11-05 Thread Robert Haas
On Thu, Nov 5, 2015 at 3:53 PM, Catalin Iacob wrote: > On Thu, Nov 5, 2015 at 5:27 PM, Robert Haas wrote: >>> I wrote some text. But needs some work of native speaker. >> >> It does. It would be nice if some kind reviewer could help volunteer >> to clean that up. > > I'll give it a go sometime n

Re: [HACKERS] proposal: multiple psql option -c

2015-11-05 Thread Catalin Iacob
On Thu, Nov 5, 2015 at 5:27 PM, Robert Haas wrote: >> I wrote some text. But needs some work of native speaker. > > It does. It would be nice if some kind reviewer could help volunteer > to clean that up. I'll give it a go sometime next week. -- Sent via pgsql-hackers mailing list (pgsql-hack

Re: [HACKERS] proposal: multiple psql option -c

2015-11-05 Thread Pavel Stehule
2015-11-05 17:27 GMT+01:00 Robert Haas : > On Tue, Nov 3, 2015 at 10:16 AM, Pavel Stehule > wrote: > >> The documentation included in this patch doesn't really make it clear > >> why -g is different from or better than -c. > > > > I wrote some text. But needs some work of native speaker. > > It d

Re: [HACKERS] proposal: multiple psql option -c

2015-11-05 Thread Robert Haas
On Tue, Nov 3, 2015 at 10:16 AM, Pavel Stehule wrote: >> The documentation included in this patch doesn't really make it clear >> why -g is different from or better than -c. > > I wrote some text. But needs some work of native speaker. It does. It would be nice if some kind reviewer could help v

Re: [HACKERS] proposal: multiple psql option -c

2015-11-03 Thread Pavel Stehule
2015-11-03 4:16 GMT+01:00 Robert Haas : > On Sat, Oct 31, 2015 at 2:50 PM, Pavel Stehule > wrote: > > fixed patch attached > > The documentation included in this patch doesn't really make it clear > why -g is different from or better than -c. > I wrote some text. But needs some work of native sp

Re: [HACKERS] proposal: multiple psql option -c

2015-11-02 Thread Robert Haas
On Sat, Oct 31, 2015 at 2:50 PM, Pavel Stehule wrote: > fixed patch attached The documentation included in this patch doesn't really make it clear why -g is different from or better than -c. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent v

Re: [HACKERS] proposal: multiple psql option -c

2015-10-31 Thread Pavel Stehule
Hi 2015-09-21 16:46 GMT+02:00 Adam Brightwell < adam.brightw...@crunchydatasolutions.com>: > Pavel, > > > with -1 option support > > FWIW, I have tried to apply this patch against master (7f11724) and > there is a minor error, see below. > > From patch: > > patching file src/bin/psql/settings.h >

Re: [HACKERS] proposal: multiple psql option -c

2015-09-21 Thread Adam Brightwell
Pavel, > with -1 option support FWIW, I have tried to apply this patch against master (7f11724) and there is a minor error, see below. >From patch: patching file src/bin/psql/settings.h Hunk #2 FAILED at 135. 1 out of 2 hunks FAILED -- saving rejects to file src/bin/psql/settings.h.rej >From s

Re: [HACKERS] proposal: multiple psql option -c

2015-08-28 Thread Pavel Stehule
2015-08-28 22:31 GMT+02:00 David G. Johnston : > On Fri, Aug 28, 2015 at 4:18 PM, Pavel Stehule > wrote: > >> >> >> 2015-08-28 22:07 GMT+02:00 Jim Nasby : >> >>> On 8/26/15 8:15 AM, Pavel Stehule wrote: >>> + and then exit. This is useful in shell scripts. Start-up files + (ps

Re: [HACKERS] proposal: multiple psql option -c

2015-08-28 Thread Pavel Stehule
2015-08-28 23:01 GMT+02:00 Jim Nasby : > On 8/28/15 3:31 PM, David G. Johnston wrote: > >> --psqlrc​ >> ​; read the standard rc files​ >> --no-psqlrc ; do not read the standard rc files >> >> It belongs in a separate patch, though. >> >> In this patch -g should disable the reading of the standard

Re: [HACKERS] proposal: multiple psql option -c

2015-08-28 Thread Jim Nasby
On 8/28/15 3:31 PM, David G. Johnston wrote: --psqlrc​ ​; read the standard rc files​ --no-psqlrc ; do not read the standard rc files It belongs in a separate patch, though. In this patch -g should disable the reading of the standard rc files. Agreed; I didn't realize -c disabled psqlrc. Ye

Re: [HACKERS] proposal: multiple psql option -c

2015-08-28 Thread David G. Johnston
On Fri, Aug 28, 2015 at 4:18 PM, Pavel Stehule wrote: > > > 2015-08-28 22:07 GMT+02:00 Jim Nasby : > >> On 8/26/15 8:15 AM, Pavel Stehule wrote: >> >>> + and then exit. This is useful in shell scripts. Start-up files >>> + (psqlrc and ~/.psqlrc) >>> are >>> + ignored with this opti

Re: [HACKERS] proposal: multiple psql option -c

2015-08-28 Thread Pavel Stehule
2015-08-28 22:07 GMT+02:00 Jim Nasby : > On 8/26/15 8:15 AM, Pavel Stehule wrote: > >> + and then exit. This is useful in shell scripts. Start-up files >> + (psqlrc and ~/.psqlrc) >> are >> + ignored with this option. >> > > Sorry if this was discussed and I missed it, but I think t

Re: [HACKERS] proposal: multiple psql option -c

2015-08-28 Thread David G. Johnston
On Fri, Aug 28, 2015 at 4:07 PM, Jim Nasby wrote: > On 8/26/15 8:15 AM, Pavel Stehule wrote: > >> + and then exit. This is useful in shell scripts. Start-up files >> + (psqlrc and ~/.psqlrc) >> are >> + ignored with this option. >> > > Sorry if this was discussed and I missed it, b

Re: [HACKERS] proposal: multiple psql option -c

2015-08-28 Thread Jim Nasby
On 8/26/15 8:15 AM, Pavel Stehule wrote: + and then exit. This is useful in shell scripts. Start-up files + (psqlrc and ~/.psqlrc) are + ignored with this option. Sorry if this was discussed and I missed it, but I think this is a bad idea. There's already an option to control th

Re: [HACKERS] proposal: multiple psql option -c

2015-08-26 Thread Pavel Stehule
Hi 2015-08-26 13:12 GMT+02:00 Pavel Stehule : > Hi > > 2015-07-29 21:05 GMT+02:00 Pavel Stehule : > >> Hi >> >> here is proof concept patch >> >> It should be cleaned, but it demonstrates a work well >> >> [pavel@localhost psql]$ ./psql -C 'select 10 x; select 20 y;' -C "\l" >> postgres >> x >

Re: [HACKERS] proposal: multiple psql option -c

2015-08-26 Thread Pavel Stehule
other example related to using psql in pipeline [pavel@localhost psql]$ ./psql postgres -q -g "vacuum analyze pg_attribute" -g "\echo :DBNAME" postgres

Re: [HACKERS] proposal: multiple psql option -c

2015-08-26 Thread Pavel Stehule
Hi 2015-07-29 21:05 GMT+02:00 Pavel Stehule : > Hi > > here is proof concept patch > > It should be cleaned, but it demonstrates a work well > > [pavel@localhost psql]$ ./psql -C 'select 10 x; select 20 y;' -C "\l" > postgres > x > > 10 > (1 row) > > y > > 20 > (1 row) > >

Re: [HACKERS] proposal: multiple psql option -c

2015-07-29 Thread Pavel Stehule
Hi here is proof concept patch It should be cleaned, but it demonstrates a work well [pavel@localhost psql]$ ./psql -C 'select 10 x; select 20 y;' -C "\l" postgres x 10 (1 row) y 20 (1 row) List of databases Name| Owner | Encoding |

Re: [HACKERS] proposal: multiple psql option -c

2015-07-28 Thread Andrew Dunstan
On 07/28/2015 11:52 AM, Pavel Stehule wrote: 2015-07-28 15:16 GMT+02:00 Andrew Dunstan >: On 07/28/2015 12:08 AM, Pavel Stehule wrote: 2015-07-28 5:24 GMT+02:00 Pavel Stehule mailto:pavel.steh...@gmail.com>

Re: [HACKERS] proposal: multiple psql option -c

2015-07-28 Thread Pavel Stehule
2015-07-28 15:16 GMT+02:00 Andrew Dunstan : > > On 07/28/2015 12:08 AM, Pavel Stehule wrote: > >> >> >> 2015-07-28 5:24 GMT+02:00 Pavel Stehule > pavel.steh...@gmail.com>>: >> >> >> >> 2015-07-27 21:57 GMT+02:00 Andrew Dunstan > >: >> >> >> On 07/27/2015

Re: [HACKERS] proposal: multiple psql option -c

2015-07-28 Thread Andrew Dunstan
On 07/28/2015 12:08 AM, Pavel Stehule wrote: 2015-07-28 5:24 GMT+02:00 Pavel Stehule >: 2015-07-27 21:57 GMT+02:00 Andrew Dunstan mailto:and...@dunslane.net>>: On 07/27/2015 02:53 PM, Pavel Stehule wrote: I am trying to run par

Re: [HACKERS] proposal: multiple psql option -c

2015-07-28 Thread Andrew Dunstan
On 07/28/2015 04:43 AM, Marc Mamin wrote: > > >2015-07-28 5:24 GMT+02:00 Pavel Stehule : > >2015-07-27 21:57 GMT+02:00 Andrew Dunstan : > >On 07/27/2015 02:53 PM, Pavel Stehule wrote: > >I am trying to run parallel execution > >psql -At -c "select datname fro

Re: [HACKERS] proposal: multiple psql option -c

2015-07-28 Thread Marc Mamin
> > >2015-07-28 10:43 GMT+02:00 Marc Mamin : > > >> >> >>2015-07-28 5:24 GMT+02:00 Pavel Stehule : >> >>2015-07-27 21:57 GMT+02:00 Andrew Dunstan : >> >>On 07/27/2015 02:53 PM, Pavel Stehule wrote: >> >>I am trying to run parallel executi

Re: [HACKERS] proposal: multiple psql option -c

2015-07-28 Thread Craig Ringer
On 17 July 2015 at 03:42, Pavel Stehule 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 co

Re: [HACKERS] proposal: multiple psql option -c

2015-07-28 Thread Pavel Stehule
2015-07-28 10:43 GMT+02:00 Marc Mamin : > > > > > > >2015-07-28 5:24 GMT+02:00 Pavel Stehule : > > > >2015-07-27 21:57 GMT+02:00 Andrew Dunstan : > > > >On 07/27/2015 02:53 PM, Pavel Stehule wrote: > > > >I am trying to run parallel execution > > > >psql -At -c

Re: [HACKERS] proposal: multiple psql option -c

2015-07-28 Thread Marc Mamin
> > >2015-07-28 5:24 GMT+02:00 Pavel Stehule : > >2015-07-27 21:57 GMT+02:00 Andrew Dunstan : > >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

Re: [HACKERS] proposal: multiple psql option -c

2015-07-27 Thread Pavel Stehule
2015-07-28 5:24 GMT+02:00 Pavel Stehule : > > > 2015-07-27 21:57 GMT+02:00 Andrew Dunstan : > >> >> 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

Re: [HACKERS] proposal: multiple psql option -c

2015-07-27 Thread Pavel Stehule
2015-07-27 21:57 GMT+02:00 Andrew Dunstan : > > 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

Re: [HACKERS] proposal: multiple psql option -c

2015-07-27 Thread Jim Nasby
On 7/27/15 2:57 PM, Andrew Dunstan wrote: 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

Re: [HACKERS] proposal: multiple psql option -c

2015-07-27 Thread Robert Haas
On Mon, Jul 27, 2015 at 2: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()" Put this in a shell script called run-psql: #!/bin/bash test $# = 0 && exit for f in "

Re: [HACKERS] proposal: multiple psql option -c

2015-07-27 Thread Andrew Dunstan
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 c

Re: [HACKERS] proposal: multiple psql option -c

2015-07-27 Thread Pavel Stehule
2015-07-27 20:47 GMT+02:00 Robert Haas : > On Mon, Jul 27, 2015 at 2:37 PM, Pavel Stehule > wrote: > > 2015-07-27 20:32 GMT+02:00 Robert Haas : > >> > >> On Sat, Jul 25, 2015 at 5:27 AM, Pavel Stehule > > >> wrote: > >> > It will be nice side effect, but my primary problem was a > impossibility

Re: [HACKERS] proposal: multiple psql option -c

2015-07-27 Thread Robert Haas
On Mon, Jul 27, 2015 at 2:37 PM, Pavel Stehule wrote: > 2015-07-27 20:32 GMT+02:00 Robert Haas : >> >> On Sat, Jul 25, 2015 at 5:27 AM, Pavel Stehule >> wrote: >> > It will be nice side effect, but my primary problem was a impossibility >> > to >> > combine VACUUM and any other statement to one s

Re: [HACKERS] proposal: multiple psql option -c

2015-07-27 Thread Pavel Stehule
2015-07-27 20:32 GMT+02:00 Robert Haas : > On Sat, Jul 25, 2015 at 5:27 AM, Pavel Stehule > wrote: > > It will be nice side effect, but my primary problem was a impossibility > to > > combine VACUUM and any other statement to one simple psql call. > > Seems like you can do that easily enough: > >

Re: [HACKERS] proposal: multiple psql option -c

2015-07-27 Thread Robert Haas
On Sat, Jul 25, 2015 at 5:27 AM, Pavel Stehule wrote: > It will be nice side effect, but my primary problem was a impossibility to > combine VACUUM and any other statement to one simple psql call. Seems like you can do that easily enough: [rhaas pgsql]$ (echo 'SELECT 1;'; echo 'VACUUM;'; echo 'S

Re: [HACKERS] proposal: multiple psql option -c

2015-07-25 Thread Pavel Stehule
2015-07-25 10:33 GMT+02:00 David G. Johnston : > On Saturday, July 25, 2015, Pavel Stehule wrote: >> >> 2015-07-23 17:52 GMT+02:00 Robert Haas : >> >>> On Fri, Jul 17, 2015 at 12:36 AM, Pavel Stehule >>> wrote: >>> >> Or just properly understand the ; ? >>> >> >>> >> -c "select * from foo; updat

[HACKERS] proposal: multiple psql option -c

2015-07-25 Thread David G. Johnston
On Saturday, July 25, 2015, Pavel Stehule wrote: > > 2015-07-23 17:52 GMT+02:00 Robert Haas : > >> On Fri, Jul 17, 2015 at 12:36 AM, Pavel Stehule >> wrote: >> >> Or just properly understand the ; ? >> >> >> >> -c "select * from foo; update bar set baz = 'bing'; vacuum bar;" >> > >> > there is a

Re: [HACKERS] proposal: multiple psql option -c

2015-07-25 Thread Pavel Stehule
2015-07-23 17:52 GMT+02:00 Robert Haas : > On Fri, Jul 17, 2015 at 12:36 AM, Pavel Stehule > wrote: > >> Or just properly understand the ; ? > >> > >> -c "select * from foo; update bar set baz = 'bing'; vacuum bar;" > > > > there is a risk of compatibility issues - all statements runs under one >

Re: [HACKERS] proposal: multiple psql option -c

2015-07-23 Thread Robert Haas
On Fri, Jul 17, 2015 at 12:36 AM, Pavel Stehule wrote: >> Or just properly understand the ; ? >> >> -c "select * from foo; update bar set baz = 'bing'; vacuum bar;" > > there is a risk of compatibility issues - all statements runs under one > transaction implicitly So what? -- Robert Haas Enter

Re: [HACKERS] proposal: multiple psql option -c

2015-07-17 Thread Marc Mamin
> On Thu, Jul 16, 2015 at 12:42 PM, Pavel Stehule > 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

Re: [HACKERS] proposal: multiple psql option -c

2015-07-16 Thread Pavel Stehule
2015-07-17 6:26 GMT+02:00 Joshua D. Drake : > > > >> it is one possible solution too >> >> multiple -c option has advantage of simple evaluation of backslash >> statements .. -c "\l" -c "\dt" - but this advantage is not high important. >> > > Or just properly understand the ; ? > > -c "select * fr

Re: [HACKERS] proposal: multiple psql option -c

2015-07-16 Thread Joshua D. Drake
it is one possible solution too multiple -c option has advantage of simple evaluation of backslash statements .. -c "\l" -c "\dt" - but this advantage is not high important. Or just properly understand the ; ? -c "select * from foo; update bar set baz = 'bing'; vacuum bar;" JD Pavel

Re: [HACKERS] proposal: multiple psql option -c

2015-07-16 Thread Pavel Stehule
2015-07-17 0:03 GMT+02:00 dinesh kumar : > On Thu, Jul 16, 2015 at 12:42 PM, Pavel Stehule > 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

Re: [HACKERS] proposal: multiple psql option -c

2015-07-16 Thread dinesh kumar
On Thu, Jul 16, 2015 at 12:42 PM, Pavel Stehule 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 i

Re: [HACKERS] proposal: multiple psql option -c

2015-07-16 Thread Pavel Stehule
2015-07-16 23:10 GMT+02:00 Rosser Schwarz : > On Thu, Jul 16, 2015 at 1:44 PM, Pavel Stehule > wrote: > >> 2015-07-16 22:07 GMT+02:00 Fabrízio de Royes Mello < >> fabriziome...@gmail.com>: >> >>> Why you want it if we already have the -f option that cover this use >>> case? >>> >> It doesn't help

  1   2   >