Hi Team,
I have resolved the issue in SQL statements for RM-5713<https://redmine.postgresql.org/issues/5713>.
PFA patch.