Re: psql - factor out echo code

2023-04-03 Thread Gregory Stark (as CFM)
On Mon, 13 Feb 2023 at 05:41, Peter Eisentraut wrote: > > I think this patch requires an up-to-date summary and explanation. The > thread is over a year old and the patch has evolved quite a bit. There > are some test changes that are not explained. Please provide more > detail so that the

Re: psql - factor out echo code

2023-02-13 Thread Peter Eisentraut
On 01.12.22 08:27, Pavel Stehule wrote: st 30. 11. 2022 v 10:43 odesílatel Fabien COELHO > napsal: >> Now some of the output generated by test_extdepend gets a bit >> confusing: >> +-- QUERY: >> + >> + >> +-- QUERY: >> >>

Re: psql - factor out echo code

2022-11-30 Thread Pavel Stehule
st 30. 11. 2022 v 10:43 odesílatel Fabien COELHO napsal: > > >> Now some of the output generated by test_extdepend gets a bit > >> confusing: > >> +-- QUERY: > >> + > >> + > >> +-- QUERY: > >> > >> That's not entirely this patch's fault. Still that's not really > >> intuitive to see the output

Re: psql - factor out echo code

2022-11-30 Thread Fabien COELHO
Now some of the output generated by test_extdepend gets a bit confusing: +-- QUERY: + + +-- QUERY: That's not entirely this patch's fault. Still that's not really intuitive to see the output of a query that's just a blank spot.. Hmmm. What about adding an explicit \echo before these empty

Re: psql - factor out echo code

2022-11-30 Thread Fabien COELHO
Hmm. The refactoring is worth it as much as the differentiation between QUERY and INTERNAL QUERY as the same pattern is repeated 5 times. Now some of the output generated by test_extdepend gets a bit confusing: +-- QUERY: + + +-- QUERY: That's not entirely this patch's fault. Still that's

Re: psql - factor out echo code

2022-11-29 Thread Michael Paquier
On Sun, Jul 24, 2022 at 10:23:39PM +0200, Pavel Stehule wrote: > I had just one question - with this patch, the format of output of modes > ECHO ALL and ECHO QUERIES will be different, and that can be a little bit > messy. On second hand, the prefix --QUERY can be disturbing in echo queries >

Re: psql - factor out echo code

2022-07-24 Thread Pavel Stehule
Hi ne 24. 7. 2022 v 21:39 odesílatel Fabien COELHO napsal: > > >> Attached v4 simplifies the format and fixes this one. > > > > I think this goes way way overboard in terms of invasiveness. There's no > > need to identify individual call sites of PSQLexec. [...] > > ISTM that having the

Re: psql - factor out echo code

2021-07-14 Thread Fabien COELHO
Attached v4 simplifies the format and fixes this one. I think this goes way way overboard in terms of invasiveness. There's no need to identify individual call sites of PSQLexec. [...] ISTM that having the information was useful for the user who actually asked for psql to show hidden

Re: psql - factor out echo code

2021-07-13 Thread Tom Lane
Fabien COELHO writes: > Attached v4 simplifies the format and fixes this one. I think this goes way way overboard in terms of invasiveness. There's no need to identify individual call sites of PSQLexec. We didn't have anything like that level of detail before, and there has been no field demand

Re: psql - factor out echo code

2021-07-11 Thread vignesh C
On Sat, Jul 10, 2021 at 10:25 PM Fabien COELHO wrote: > > > Hello Vignesh, > > > I am changing the status to "Needs review" as the review is not > > completed for this patch and also there are some tests failing, that > > need to be fixed: > > test test_extdepend ... FAILED 50

Re: psql - factor out echo code

2021-07-10 Thread Fabien COELHO
Hello Vignesh, I am changing the status to "Needs review" as the review is not completed for this patch and also there are some tests failing, that need to be fixed: test test_extdepend ... FAILED 50 ms Indeed, Attached v4 simplifies the format and fixes this one. I ran

Re: psql - factor out echo code

2021-07-10 Thread vignesh C
On Sat, Jul 3, 2021 at 3:07 AM Fabien COELHO wrote: > > > > "-- # QUERY\n%s\n\n" > > Attached an attempt along those lines. I found another duplicate of the > ascii-art printing in another function. > > Completion queries seems to be out of the echo/echo hidden feature. > > Incredible, there is

Re: psql - factor out echo code

2021-07-02 Thread Fabien COELHO
"-- # QUERY\n%s\n\n" Attached an attempt along those lines. I found another duplicate of the ascii-art printing in another function. Completion queries seems to be out of the echo/echo hidden feature. Incredible, there is a (small) impact on regression tests for the \gexec case. All

Re: psql - factor out echo code

2021-07-02 Thread Tom Lane
Alvaro Herrera writes: > I think the most interesting case for decoration is the "step by step" > mode, where you want the "title" that precedes each query be easily > visible. I'm okay with leaving the step-by-step prompt as-is, personally. It's the inconsistency of the other ones that bugs me.

Re: psql - factor out echo code

2021-07-02 Thread Alvaro Herrera
On 2021-Jul-02, Tom Lane wrote: > Fabien COELHO writes: > > Yes. Maybe decorations should be SQL comments, and the purpose/origin of > > the query could be made clear as you suggest, eg something like markdown > > in a comment: > >"-- # QUERY\n%s\n\n" > > If we keep the decoration, I'd

Re: psql - factor out echo code

2021-07-02 Thread Tom Lane
Fabien COELHO writes: > Yes. Maybe decorations should be SQL comments, and the purpose/origin of > the query could be made clear as you suggest, eg something like markdown > in a comment: >"-- # QUERY\n%s\n\n" If we keep the decoration, I'd agree with dropping all the asterisks. I'd vote

Re: psql - factor out echo code

2021-07-02 Thread Fabien COELHO
Hello Tom, I went to commit this, figuring that it was a trivial bit of code consolidation, but as I looked around in common.c I got rather unhappy with the inconsistent behavior of things. Examining the various places that implement "echo"-related logic, we have the three places this patch

Re: psql - factor out echo code

2021-07-02 Thread Tom Lane
Fabien COELHO writes: > [ psql-echo-2.patch ] I went to commit this, figuring that it was a trivial bit of code consolidation, but as I looked around in common.c I got rather unhappy with the inconsistent behavior of things. Examining the various places that implement "echo"-related logic, we

RE: psql - factor out echo code

2021-06-15 Thread Shinya11.Kato
>> Wouldn't it be better to comment it like any other function? > >Sure. Attached. Thank you for your revision. I think this patch is good, so I will move it to ready for committer. Best regards, Shinya Kato

RE: psql - factor out echo code

2021-06-14 Thread Fabien COELHO
Wouldn't it be better to comment it like any other function? Sure. Attached. -- Fabien.diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c index 9a00499510..00e5bf290b 100644 --- a/src/bin/psql/common.c +++ b/src/bin/psql/common.c @@ -523,6 +523,18 @@ PrintTiming(double elapsed_msec)

RE: psql - factor out echo code

2021-06-13 Thread Shinya11.Kato
>-Original Message- >From: Fabien COELHO >Sent: Sunday, May 30, 2021 6:10 PM >To: PostgreSQL Developers >Subject: psql - factor out echo code > > >While working on something in "psql/common.c" I noticed some triplicated code, >including a long

psql - factor out echo code

2021-05-30 Thread Fabien COELHO
While working on something in "psql/common.c" I noticed some triplicated code, including a long translatable string. This minor patch refactors this in one function. -- Fabien.diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c index 7a95465111..4fd80ec6bb 100644 ---