RE: psql - add SHOW_ALL_RESULTS option

From: "Iwata, Aya" <iwata(dot)aya(at)jp(dot)fujitsu(dot)com>
To: 'Fabien COELHO' <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: psql - add SHOW_ALL_RESULTS option
Date: 2019-04-24 02:34:39
Message-ID: 71E660EB361DF14299875B198D4CE5423DF3414B@g01jpexmbkw25
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 it is 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2019-04-24 02:53:20 Re: pg_dump partitions can lead to inconsistent state after restore
Previous Message Matsumura, Ryo 2019-04-24 02:12:21 RE: Patch: doc for pg_logical_emit_message()