Hi Dave,
Thanks for the comments.
Find the attached patch with below fix.
--- Incomplete comments removed and added new comments
--- s/Closed/Materialized/
--- Added column "relkind" in outer query and removed the SELECT from the loop.
--- Combined the below statement.
"(collection->GetConnection()->BackendMinimumVersion(9, 3))"
Please let me know for further comments.
Thanks,
Neel Patel