Re: psql - add SHOW_ALL_RESULTS option

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>, vignesh C <vignesh21@gmail.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, daniel@manitou-mail.org, peter.eisentraut@2ndquadrant.com, iwata.aya@jp.fujitsu.com, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2020-01-16T21:33:48Z
Lists: pgsql-hackers
Hello Tom,

>> This is one of the patches already marked as RFC (since September by
>> Alvaro). Anyone interested in actually pushing it, so that it does not
>> fall through to yet another commitfest?
>
> TBH, I think we'd be better off to reject it.  This makes a nontrivial
> change in a very long-standing psql behavior, with AFAICS no way to
> get back the old semantics.  (The thread title is completely misleading
> about that; there's no "option" in the patch as it stands.)

The thread title was not misleading, the initial version of the patch did 
offer an option. Then I was said "the current behavior is stupid (which I 
agree), let us change it to the sane behavior without option", then I'm 
told the contrary. Sigh.

I still have the patch with the option, though.

> Sure, in a green field this behavior would likely be more sensible ... 
> but that has to be weighed against the fact that it's behaved the way it 
> does for a long time, and any existing scripts that are affected by that 
> behavior have presumably deliberately chosen to use it.

I cannot imagine many people actually relying on the current insane 
behavior.

> I can't imagine that changing this will make very many people happier.
> It seems much more likely that people who are affected will be unhappy.
>
> The compatibility issue could be resolved by putting in the option
> that I suppose was there at the beginning.

Indeed.

> But then we'd have to have a debate about which behavior would be 
> default,

The patch was keeping current behavior as the default because people do 
not like a change whatever.

> and there would still be the question of who would find this to 
> be an improvement. If you're chaining together commands with \; then 
> it's likely that you are happy with the way it behaves today. 
> Certainly there's been no drumbeat of bug reports about it.

Why would there be bug report if this is a feature? :-)

The behavior has been irritating me for a long time. It is plain stupid to 
be able to send queries but not see their results.

-- 
Fabien.



Commits

  1. psql: Show all query results by default

  2. psql: Refactor ProcessResult()

  3. psql: Refactor SendQuery()

  4. psql: Add test for psql behavior on server crash

  5. psql: Additional tests

  6. Improve some psql test code

  7. psql: Fix some scan-build warnings

  8. psql: Add test for handling of replication commands

  9. psql: More tests

  10. psql: Add various tests

  11. psql: Add test for query canceling

  12. Revert "psql: Show all query results by default"

  13. Extend a test case a little