Alvaro Herrera <alvhe...@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


Reply via email to