Re: [patch] \g with multiple result sets and \watch with copy queries

2022-11-01 Thread Daniel Verite
Corey Huinker wrote: > I think that because it is more complicated than usual psql, we may want to > comment on the intention of the tests and some of the less-than-common psql > elements (\set concatenation, resetting \o, etc). If you see value in that > I can amend the patch. If the int

Re: [patch] \g with multiple result sets and \watch with copy queries

2022-10-10 Thread Fabien COELHO
Bonjour Daniel, Good catch! Thanks for the quick fix! As usual, what is not tested does not:-( Attached a tap test to check for the expected behavior with multiple command \g. -- Fabien.diff --git a/src/bin/psql/t/001_basic.pl b/src/bin/psql/t/001_basic.pl index f447845717..c81feadd4e 10064

Re: [patch] \g with multiple result sets and \watch with copy queries

2022-10-10 Thread Corey Huinker
> > This is a bit more complicated than the usual tests, but not > that much. > Any opinions on this? +1 I think that because it is more complicated than usual psql, we may want to comment on the intention of the tests and some of the less-than-common psql elements (\set concatenation, resetting

Re: [patch] \g with multiple result sets and \watch with copy queries

2022-10-07 Thread Daniel Verite
Tom Lane wrote: > > Currently, test/regress/sql/psql.sql doesn't AFAICS write anything > > outside of stdout, but \g, \o, \copy need to write to external > > files to be tested properly. > > Yeah, I don't think we can usefully test these in psql.sql, because > file-system side effects ar

Re: [patch] \g with multiple result sets and \watch with copy queries

2022-10-04 Thread Tom Lane
"Daniel Verite" writes: > Tom Lane wrote: >> Given the time pressure, I did not worry about installing regression >> test coverage for this stuff, but I wonder if we shouldn't add some. > Currently, test/regress/sql/psql.sql doesn't AFAICS write anything > outside of stdout, but \g, \o, \co

Re: [patch] \g with multiple result sets and \watch with copy queries

2022-10-04 Thread Daniel Verite
Tom Lane wrote: > Pushed after making some corrections. Thanks! > Given the time pressure, I did not worry about installing regression > test coverage for this stuff, but I wonder if we shouldn't add some. Currently, test/regress/sql/psql.sql doesn't AFAICS write anything outside of std

Re: [patch] \g with multiple result sets and \watch with copy queries

2022-10-03 Thread Tom Lane
I wrote: > Ugh. I think we'd better fix that before 15.0, else somebody may > think this is the new intended behavior and raise compatibility > concerns when we fix it. I will see if I can squeeze it in before > this afternoon's 15rc2 wrap. Pushed after making some corrections. Given the time p

Re: [patch] \g with multiple result sets and \watch with copy queries

2022-10-03 Thread Tom Lane
"Daniel Verite" writes: > The psql improvement in v15 to output multiple result sets does not > behave as one might expect with \g: the output file or program > to pipe into is opened/closed on each result set, overwriting the > previous ones in the case of \g file. Ugh. I think we'd better fix