Re: support for MERGE - Mailing list pgsql-hackers

From Tom Lane
Subject Re: support for MERGE
Date
Msg-id 21030.1652893083@sss.pgh.pa.us
Whole thread Raw
In response to support for MERGE  (Ranier Vilela <ranier.vf@gmail.com>)
Responses Re: support for MERGE
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: support for MERGE
Next
From: vignesh C
Date:
Subject: Re: Skipping schema changes in publication