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