Hi Japin,
>
>
> Here is a poc patch to verify the above.
>
>
The patch looks reasonable to me, it is in line with `get_select_query_def()
<https://github.com/postgres/postgres/blob/8aee330af55d8a759b2b73f5a771d9d34a7b887f/src/backend/utils/adt/ruleutils.c#L5745-L5752>`
.
Though, probably requires a regression test.
Thanks,
Onder