I'm using PostgreSQL, that needs to run in Replica Server. I'm using not distinct from to collect all the data. I'm running the query in dbeaver. When I execute the query, the debugger showing the following error.I did lots of research about this issue, i don't have access for the server. I need to know any alternate way of rectifying this, by modifying the query. Can anyone advise how do I do it?
I need to implement this kind of query in SSRS.
I need to run the report in the same server without change any configuration. Or advise what I need to do in server end, what are the root causes of this replication errors, do we have any limitations?
Query:
select
tb1.column1,
tb1.column2,
tb2.column1,
tb2.column2,
tb5.column1,
sum(tb5.column6) as column6,
sum(tb5.column7) as column7
from
table1 tb1
left join table2 tb2 on table1.id = table2.tb1_fk
left join table3 tb3 on table2.id = table3.tb2_fk
left join table4 tb4 on table3.id = table4.tb3_fk
left join table5 tb5 on table3.id = table5.tb4_fk
where tb4.id is not distinct from coalesce(NULL. tb4.id)
and tb2.id is not distinct from coalesce(NULL. tb2.id)
and tb3.id is not distinct from coalesce(NULL. tb3.id)
and tb5.id is not distinct from coalesce(NULL. tb5.d)
and tb3.columndate + (interval '1 minute' * timetable.timezone_offset))::date >= ? OR CAST(NULL AS timestamp) IS NULL)
and tb3.columndate + (interval '1 minute' * timetable.timezone_offset))::date <= ? OR CAST(NULL AS timestamp) IS NULL)
group by
tb1.column1,
tb1.column2,
tb2.column1,
tb2.column2,
tb5.column1
Error:
SQL Error [40001]: ERROR: canceling statement due to conflict with recovery
Detail: User query might have needed to see row versions that must be removed.