Re: support for MERGE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Japin Li <japinli(at)hotmail(dot)com>, Zhihong Yu <zyu(at)yugabyte(dot)com>, Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Daniel Westermann <dwe(at)dbi-services(dot)com>, Erik Rijkers <er(at)xs4all(dot)nl>, Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: support for MERGE
Date: 2022-05-18 16:58:03
Message-ID: 21030.1652893083@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2022-05-18 17:45:08 Re: Skipping schema changes in publication
Previous Message Justin Pryzby 2022-05-18 16:57:15 Re: support for MERGE