Re: MERGE output doubt

2022-11-17 Thread Alvaro Herrera
On 2022-Nov-17, Alvaro Herrera wrote: > On 2022-Oct-20, Luca Ferrari wrote: > > > I was expecting an output tag like "MERGE 0" since both branches have > > "do nothing", so no tuples should be updated at all on the target > > table. > > Hmm, yeah, it should report 0 tuples, according to the docu

Re: MERGE output doubt

2022-11-17 Thread Alvaro Herrera
On 2022-Oct-20, Luca Ferrari wrote: > Now, if I use a do nothing merge: > > estdb=> MERGE INTO average_scores a > USING ( SELECT name, avg( score ) AS avg_score >FROM scores GROUP BY name ) s > ON s.name = a.name > WHEN MATCHED THEN >do nothing > WHEN NOT MATCHED THEN >do nothin

MERGE output doubt

2022-10-20 Thread Luca Ferrari
Hi all, I'm experimenting with the new MERGE command, but I'm not getting the output total count. From the docs : "The total_count is the total number of rows changed ". This is my simple setup: testdb=> table scores; pk | name | score +--