Aggregation Query

Hi All, iam doing a aggregation query insert into another table. Now when the id is duplicate i set the value to overwrite with:

on conflict (id) do update set
val_average = val_average,
val_count = val_count,
val_max = val_max,
val_min = val_min,
val_sum = val_sum;

Hi All, iam doing a aggregation query insert into another table. Now when the id is duplicate i set the value to overwrite with:

     val_average = val_average,
     val_count = val_count,
     val_max = val_max,
     val_min = val_min,
     val_sum = val_sum;

The create date shows the row should be updated. but the actual value is not. Do you have an idea why this is?

or do i need to use?

     val_average = val_average,
     val_count = excluded.val_count,
     val_max = excluded.val_max,
     val_min = excluded.val_min,
     val_sum = excluded.val_sum;```