pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: Japin Li <japinli@hotmail.com>
Cc: Zhihong Yu <zyu@yugabyte.com>
Cc: Simon Riggs <simon.riggs@enterprisedb.com>
Cc: pgsql-hackers@lists.postgresql.org, Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: Daniel Westermann <dwe@dbi-services.com>
Cc: Erik Rijkers <er@xs4all.nl>
Cc: Jaime Casanova <jcasanov@systemguards.com.ec>
Cc: Andres Freund <andres@anarazel.de>
Subject: Re: support for MERGE
Date: Wed, 18 May 2022 12:58:03 -0400
Message-ID: <21030.1652893083@sss.pgh.pa.us> (raw)
In-Reply-To: <202205181636.v26g2zvkeeks@alvherre.pgsql>
References: <202205181636.v26g2zvkeeks@alvherre.pgsql>

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> I chose the other way :-)

I don't think the committed patch will behave nicely in edge cases:

+           if (es->format == EXPLAIN_FORMAT_TEXT && total > 0)
+           {
+               ExplainIndentText(es);
+               appendStringInfoString(es->str, "Tuples:");
+               if (insert_path > 0)
+                   appendStringInfo(es->str, " inserted=%.0f", insert_path);
+               if (update_path > 0)
+                   appendStringInfo(es->str, " updated=%.0f", update_path);
+               if (delete_path > 0)
+                   appendStringInfo(es->str, " deleted=%.0f", delete_path);
+               if (skipped_path > 0)
+                   appendStringInfo(es->str, " skipped=%.0f", skipped_path);
+               appendStringInfoChar(es->str, '\n');
+           }
+           else
+           {
+               ExplainPropertyFloat("Tuples Inserted", NULL, insert_path, 0, es);
+               ExplainPropertyFloat("Tuples Updated", NULL, update_path, 0, es);
+               ExplainPropertyFloat("Tuples Deleted", NULL, delete_path, 0, es);
+               ExplainPropertyFloat("Tuples Skipped", NULL, skipped_path, 0, es);
+           }

If it's text format and total is 0, I'd wish it to print nothing,
not to revert to the verbose format.

			regards, tom lane





view thread (123+ messages)  latest in thread

Message-ID: <21030.1652893083@sss.pgh.pa.us>
Permalink:  ../21030.1652893083@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21030.1652893083@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org, pryzby@telsasoft.com, peter.eisentraut@enterprisedb.com, amitlangote09@gmail.com, japinli@hotmail.com, zyu@yugabyte.com, simon.riggs@enterprisedb.com, tomas.vondra@enterprisedb.com, dwe@dbi-services.com, er@xs4all.nl, jcasanov@systemguards.com.ec, andres@anarazel.de
  Subject: Re: support for MERGE
  In-Reply-To: <21030.1652893083@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox