Re: [HACKERS] Suggested fix for \p and \r in psql

2017-04-02 Thread Tom Lane
"Daniel Verite" writes: > Tom Lane wrote: >> If we do phrase it like that, I think that the most natural behavior >> for \r is the way I have it in HEAD --- you'd expect it to clear >> the query buffer, but you would not expect it to forget the most >> recent command. > Okay, leaving out \r

Re: [HACKERS] Suggested fix for \p and \r in psql

2017-04-02 Thread Daniel Verite
Tom Lane wrote: > If we do phrase it like that, I think that the most natural behavior > for \r is the way I have it in HEAD --- you'd expect it to clear > the query buffer, but you would not expect it to forget the most > recent command. Okay, leaving out \r as it is and changing only \p

Re: [HACKERS] Suggested fix for \p and \r in psql

2017-04-02 Thread Tom Lane
"Daniel Verite" writes: > The documentation over-simplifies things as if there > was only one query buffer, instead of two of them. Yeah, there's a lot of oversimplification in the docs for slash commands --- for instance, I was just noticing yesterday that there's no mention of the variant argum

Re: [HACKERS] Suggested fix for \p and \r in psql

2017-04-02 Thread Daniel Verite
Tom Lane wrote: > > 1. \p ignores the "previous buffer". Example: > > Yeah, I did that intentionally, thinking that the old behavior was > confusing. We can certainly discuss it though. I'd tend to agree > with your point that \p and \w should print the same thing, but > maybe neither o

Re: [HACKERS] Suggested fix for \p and \r in psql

2017-04-02 Thread Fabien COELHO
1. \p ignores the "previous buffer". Example: Yeah, I did that intentionally, thinking that the old behavior was confusing. We can certainly discuss it though. I'd tend to agree with your point that \p and \w should print the same thing, but maybe neither of them should look at the previous_

Re: [HACKERS] Suggested fix for \p and \r in psql

2017-04-02 Thread Tom Lane
I wrote: > "Daniel Verite" writes: >> 1. \p ignores the "previous buffer". Example: > Yeah, I did that intentionally, thinking that the old behavior was > confusing. We can certainly discuss it though. I'd tend to agree > with your point that \p and \w should print the same thing, but > maybe n

Re: [HACKERS] Suggested fix for \p and \r in psql

2017-04-02 Thread Tom Lane
"Daniel Verite" writes: > I've noticed two issues with the query buffer post-commit e984ef5 > (Support \if ... \elif ... \else ... \endif in psql scripting): > 1. \p ignores the "previous buffer". Example: Yeah, I did that intentionally, thinking that the old behavior was confusing. We can cert

Re: [HACKERS] Suggested fix for \p and \r in psql

2017-04-02 Thread Fabien COELHO
Hello Daniel, I've noticed two issues with the query buffer post-commit e984ef5 (Support \if ... \elif ... \else ... \endif in psql scripting): I thought that Tom's changes were somehow intentional, in order to simplify the code. 1. \p ignores the "previous buffer". Example: postgres=# s