On Fri, Oct 14, 2022 at 10:43 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Richard Guo <guofenglinux@gmail.com> writes: > Or maybe we can make it even earlier, when we expand an RTE for a > partitioned table and add result tables to leaf_result_relids.
I'm not really on board with injecting command-type-specific logic into completely unrelated places just so that we can throw an error a bit earlier. Alvaro's suggestion of make_modifytable seemed plausible, not least because it avoids spending any effort when the command couldn't be MERGE at all.
Yeah, that makes sense. Putting this check in inherit.c does look some weird as there is no other commandType related code in that file.
Agree that Alvaro's suggestion is more reasonable.