Re: psql - add SHOW_ALL_RESULTS option
Fabien COELHO <coelho@cri.ensmp.fr>
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Daniel Verite <daniel@manitou-mail.org>,
"Iwata, Aya" <iwata.aya@jp.fujitsu.com>,
PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2019-07-22T13:33:55Z
Lists: pgsql-hackers
Hello Peter, >> I'd go further and suggest that there shouldn't be a variable >> controlling this. All results that come in should be processed, period. > > I agree with that. I kind of agree as well, but I was pretty sure that someone would complain if the current behavior was changed. Should I produce a patch where the behavior is not an option, or turn the option on by default, or just keep it like that for the time being? >> It's not just about \; If the ability of CALL to produce multiple >> resultsets gets implemented (it was posted as a POC during v11 >> development), this will be needed too. > > See previous patch here: > https://www.postgresql.org/message-id/flat/4580ff7b-d610-eaeb-e06f-4d686896b93b%402ndquadrant.com > > In that patch, I discussed the specific ways in which \timing works in > psql and how that conflicts with multiple result sets. What is the > solution to that in this patch? \timing was kind of a ugly feature to work around. The good intention behind \timing is that it should reflect the time to perform the query from the client perspective, but should not include processing the results. However, if a message results in several queries, they are processed as they arrive, so that \timing reports the time to perform all queries and the time to process all but the last result. Although on paper we could try to get all results first, take the time, then process them, this does not work in the general case because COPY takes on the connection so you have to process its result before switching to the next result. There is also some stuff to handle notices which are basically send as events when they occur, so that the notice shown are related to the result under processing. -- Fabien.
Commits
-
psql: Show all query results by default
- 7844c9918a43 15.0 landed
- 3a5130672296 14.0 landed
-
psql: Refactor ProcessResult()
- 5519d5affdfa 15.0 landed
-
psql: Refactor SendQuery()
- 8910a25fef3d 15.0 landed
-
psql: Add test for psql behavior on server crash
- 8cd7627c7b19 15.0 landed
-
psql: Additional tests
- 9028cce426ba 15.0 landed
-
Improve some psql test code
- fbee60f6a4ff 15.0 landed
-
psql: Fix some scan-build warnings
- 390edeeb570c 15.0 landed
-
psql: Add test for handling of replication commands
- 67c069848a99 15.0 landed
-
psql: More tests
- c0280bc3edeb 15.0 landed
-
psql: Add various tests
- 14d755b00037 15.0 landed
-
psql: Add test for query canceling
- 5b3f471ff23a 15.0 landed
-
Revert "psql: Show all query results by default"
- fae65629cec8 14.0 landed
-
Extend a test case a little
- b3a9e9897ec7 14.0 landed