Hi,
I tested the v2 patch and I would like to share my observations.
Before applying the patch, pg_get_viewdef() generated output such as
ORDER BY (- 3), which could be misinterpreted as a column position
when the view definition was parsed again.
After applying the patch, the output included the explicit type cast,
for example, ORDER BY (- 3::integer). I also verified that the
recreated views worked correctly.
The regression tests covering ORDER BY, GROUP BY, and reloading the
generated view definitions passed, and all regression tests passed in
my testing environment.
Based on these results, the patch appears to address the reported
issue. Thank you for your work on this fix.
Regards,
Solai