Richard Guo <[email protected]> writes:
> Thanks for looking!  Yeah, I chose to use addRangeTableEntryForJoin in
> add_antijoin_rte() because I noticed that convert_ANY_sublink_to_join
> is using addRangeTableEntryForSubquery.  But I agree that this is
> abuse of the parser and we should avoid that.

> In v2, I updated add_antijoin_rte() to build the RTE by hand, much as
> transform_MERGE_to_join() does for its join RTE.

v2 works for me.

> I left convert_ANY_sublink_to_join alone in this patch, since the fix
> needs to go back to v16 and that change isn't needed for it.  We can
> do it as a follow-up cleanup on master.
> (I'm not sure about a shared function though.  The subquery RTE needs
> the subquery, the lateral flag and column names taken from its
> targetlist, while the join RTE needs nothing but the jointype, so
> about all the two have in common is the makeNode and the lappend.)

Fair enough on both points.  convert_ANY_sublink_to_join has been like
that for a long time and hasn't caused trouble, so I'm not in a huge
hurry to change it.

                        regards, tom lane


Reply via email to