RE: psql - add SHOW_ALL_RESULTS option - Mailing list pgsql-hackers

From Iwata, Aya
Subject RE: psql - add SHOW_ALL_RESULTS option
Date
Msg-id 71E660EB361DF14299875B198D4CE5423DF3414B@g01jpexmbkw25
Whole thread Raw
In response to psql - add SHOW_ALL_RESULTS option  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses RE: psql - add SHOW_ALL_RESULTS option
List pgsql-hackers
Hi Fabien, 

I review your patch. 

> Add a few tests for the new feature.
+++ b/src/test/regress/expected/psql.out
@@ -4729,3 +4729,46 @@ drop schema testpart;
 set search_path to default;
 set role to default;
 drop role testrole_partitioning;
+-- 
There is space (+--' '). Please delete it. It is cause of regression test failed.

> IMHO this new setting should be on by default: few people know about \; so
> it would not change anything for most, and I do not see why those who use
> it would not be interested by the results of all the queries they asked for.
I agree with your opinion.

I test some query combination case. And I found when warning happen, the message is printed in head of results. I think
itis not clear in which query the warning occurred.
 
How about print warning message before the query that warning occurred?

For example,
-- devide by ';'
postgres=# BEGIN; BEGIN; SELECT 1 AS one; COMMIT; BEGIN; BEGIN; SELECT 1 AS one; COMMIT;
BEGIN
psql: WARNING:  there is already a transaction in progress
BEGIN
 one 
-----
   1
(1 row)

COMMIT
BEGIN
psql: WARNING:  there is already a transaction in progress
BEGIN
 one 
-----
   1
(1 row)

COMMIT


-- devide by '\;' and set SHOW_RESULT_ALL on
postgres=# \set SHOW_ALL_RESULTS on
postgres=# BEGIN\; BEGIN\; SELECT 1 AS one\; COMMIT\; BEGIN\; BEGIN\; SELECT 1 AS one\; COMMIT;
psql: WARNING:  there is already a transaction in progress
BEGIN
BEGIN
 one 
-----
   1
(1 row)

psql: WARNING:  there is already a transaction in progress
COMMIT
BEGIN
BEGIN
 one 
-----
   1
(1 row)

COMMIT

I will check the code soon.

Regards, 
Aya Iwata




pgsql-hackers by date:

Previous
From: "Matsumura, Ryo"
Date:
Subject: RE: Patch: doc for pg_logical_emit_message()
Next
From: Amit Langote
Date:
Subject: Re: pg_dump partitions can lead to inconsistent state after restore