I tried to upgrade Sonar application [hosted in windows server] from 7.9.6 to 8.9 and i faced few issues in DB migration. So I have reverted back both application and database [external database - postgresql].
After restoration, application is up and running fine. But it can’t able to update the database. I am getting the below error in all the builds.
Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification
### The error may exist in org.sonar.db.measure.LiveMeasureMapper
### The error may involve org.sonar.db.measure.LiveMeasureMapper.upsert-Inline
### The error occurred while setting parameters
### SQL: insert into live_measures ( uuid, component_uuid, project_uuid, metric_id, value, text_value, variation, measure_data, created_at, updated_at ) values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?,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?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ),( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) on conflict(component_uuid, metric_id) do update set value = excluded.value, variation = excluded.variation, text_value = excluded.text_value, measure_data = excluded.measure_data, updated_at = excluded.updated_at where live_measures.value is distinct from excluded.value or live_measures.variation is distinct from excluded.variation or live_measures.text_value is distinct from excluded.text_value or live_measures.measure_data is distinct from excluded.measure_data
### Cause: org.postgresql.util.PSQLException: ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification
Can anyone help to fix this issue.